diff --git a/.coveragerc b/.coveragerc index c2e5ab67..1190ab96 100644 --- a/.coveragerc +++ b/.coveragerc @@ -4,6 +4,7 @@ branch = true source = cvat/apps/ + cvat-sdk/ cvat-cli/ utils/dataset_manifest diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index 514ddb44..31ed1f26 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -14,16 +14,47 @@ jobs: PR_FILES_AM: ${{ steps.files.outputs.added_modified }} PR_FILES_RENAMED: ${{ steps.files.outputs.renamed }} run: | + # If different modules use different Black configs, + # we need to run Black for each python component group separately. + # Otherwise, they all will use the same config. + ENABLED_DIRS=("cvat-sdk" "cvat-cli" "tests/python/sdk" "tests/python/cli") + + isValueIn () { + # Checks if a value is in an array + # https://stackoverflow.com/a/8574392 + # args: value, array + local e match="$1" + shift + for e; do + [[ "$e" == "$match" ]] && return 0; + done + return 1 + } + + startswith () { + # Inspired by https://stackoverflow.com/a/2172367 + # Checks if the first arg starts with the second one + local value="$1" + local beginning="$2" + return $([[ $value == ${beginning}* ]]) + } + PR_FILES="$PR_FILES_AM $PR_FILES_RENAMED" + UPDATED_DIRS="" for FILE in $PR_FILES; do EXTENSION="${FILE##*.}" - DIRECTORY="${FILE%%/*}" - if [[ "$EXTENSION" == "py" && "$DIRECTORY" == "cvat-cli" ]]; then - CHANGED_FILES+=" $FILE" + DIRECTORY="$(dirname $FILE)" + if [[ "$EXTENSION" == "py" ]]; then + for EDIR in ${ENABLED_DIRS[@]}; do + if startswith "${DIRECTORY}/" "${EDIR}/" && ! isValueIn "${EDIR}" ${UPDATED_DIRS[@]}; + then + UPDATED_DIRS+=" ${EDIR}" + fi + done fi done - if [[ ! -z $CHANGED_FILES ]]; then + if [[ ! -z $UPDATED_DIRS ]]; then sudo apt-get --no-install-recommends install -y build-essential curl python3-dev python3-pip python3-venv python3 -m venv .env . .env/bin/activate @@ -32,8 +63,11 @@ jobs: mkdir -p black_report echo "Black version: "$(black --version) - echo "The files will be checked: "$(echo $CHANGED_FILES) - black --check --config ./cvat-cli/pyproject.toml $CHANGED_FILES > ./black_report/black_checks.txt || EXIT_CODE=$(echo $?) || true + echo "The dirs will be checked: $UPDATED_DIRS" + EXIT_CODE=0 + for DIR in $UPDATED_DIRS; do + black --check $DIR >> ./black_report/black_checks.txt || EXIT_CODE=$(($? | $EXIT_CODE)) || true + done deactivate exit $EXIT_CODE else diff --git a/.github/workflows/full.yml b/.github/workflows/full.yml index 16edc24d..1ba61db9 100644 --- a/.github/workflows/full.yml +++ b/.github/workflows/full.yml @@ -164,11 +164,20 @@ jobs: docker load --input /tmp/cvat_ui/image.tar docker image ls -a - - name: Running REST API tests + - name: Running REST API and SDK tests run: | + docker run --rm -v ${PWD}/cvat-sdk/schema/:/transfer \ + --entrypoint /bin/bash -u root cvat/server \ + -c 'python manage.py spectacular --file /transfer/schema.yml' + pip3 install --user -r cvat-sdk/gen/requirements.txt + cd cvat-sdk/ + gen/generate.sh + cd .. + pip3 install --user cvat-sdk/ - pip3 install --user -r tests/rest_api/requirements.txt - pytest tests/rest_api/ -s -v + pip3 install --user cvat-cli/ + pip3 install --user -r tests/python/requirements.txt + pytest tests/python -s -v - name: Creating a log file from cvat containers if: failure() @@ -226,7 +235,7 @@ jobs: while [[ $(curl -s -o /dev/null -w "%{http_code}" localhost:8181/health) != "200" && max_tries -gt 0 ]]; do (( max_tries-- )); sleep 5; done docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml run cvat_ci /bin/bash \ - -c 'python manage.py test cvat/apps cvat-cli -v 2' + -c 'python manage.py test cvat/apps -v 2' docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml run cvat_ci /bin/bash \ -c 'yarn --frozen-lockfile --ignore-scripts && yarn workspace cvat-core run test' diff --git a/.github/workflows/isort.yml b/.github/workflows/isort.yml index 25f83344..950fcef4 100644 --- a/.github/workflows/isort.yml +++ b/.github/workflows/isort.yml @@ -14,16 +14,47 @@ jobs: PR_FILES_AM: ${{ steps.files.outputs.added_modified }} PR_FILES_RENAMED: ${{ steps.files.outputs.renamed }} run: | + # If different modules use different isort configs, + # we need to run isort for each python component group separately. + # Otherwise, they all will use the same config. + ENABLED_DIRS=("cvat-sdk" "cvat-cli" "tests/python/sdk" "tests/python/cli") + + isValueIn () { + # Checks if a value is in an array + # https://stackoverflow.com/a/8574392 + # args: value, array + local e match="$1" + shift + for e; do + [[ "$e" == "$match" ]] && return 0; + done + return 1 + } + + startswith () { + # Inspired by https://stackoverflow.com/a/2172367 + # Checks if the first arg starts with the second one + local value="$1" + local beginning="$2" + return $([[ $value == ${beginning}* ]]) + } + PR_FILES="$PR_FILES_AM $PR_FILES_RENAMED" + UPDATED_DIRS="" for FILE in $PR_FILES; do EXTENSION="${FILE##*.}" - DIRECTORY="${FILE%%/*}" - if [[ "$EXTENSION" == "py" && "$DIRECTORY" == "cvat-cli" ]]; then - CHANGED_FILES+=" $FILE" + DIRECTORY="$(dirname $FILE)" + if [[ "$EXTENSION" == "py" ]]; then + for EDIR in ${ENABLED_DIRS[@]}; do + if startswith "${DIRECTORY}/" "${EDIR}/" && ! isValueIn "${EDIR}" ${UPDATED_DIRS[@]}; + then + UPDATED_DIRS+=" ${EDIR}" + fi + done fi done - if [[ ! -z $CHANGED_FILES ]]; then + if [[ ! -z $UPDATED_DIRS ]]; then sudo apt-get --no-install-recommends install -y build-essential curl python3-dev python3-pip python3-venv python3 -m venv .env . .env/bin/activate @@ -32,8 +63,11 @@ jobs: mkdir -p isort_report echo "isort version: "$(isort --version) - echo "The files will be checked: "$(echo $CHANGED_FILES) - isort --check --sp ./cvat-cli/pyproject.toml $CHANGED_FILES > ./isort_report/isort_checks.txt || EXIT_CODE=$(echo $?) || true + echo "The dirs will be checked: $UPDATED_DIRS" + EXIT_CODE=0 + for DIR in $UPDATED_DIRS; do + isort --check $DIR >> ./isort_report/isort_checks.txt || EXIT_CODE=$(($? | $EXIT_CODE)) || true + done deactivate exit $EXIT_CODE else diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6880c03a..1e2fa7fd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -133,9 +133,17 @@ jobs: - name: Running REST API tests run: | + docker run --rm -v ${PWD}/cvat-sdk/schema/:/transfer \ + --entrypoint /bin/bash -u root cvat/server \ + -c 'python manage.py spectacular --file /transfer/schema.yml' + pip3 install --user -r cvat-sdk/gen/requirements.txt + cd cvat-sdk/ + gen/generate.sh + cd .. + pip3 install --user cvat-sdk/ - pip3 install --user -r tests/rest_api/requirements.txt - pytest tests/rest_api/ -k 'GET' -s + pip3 install --user -r tests/python/requirements.txt + pytest tests/python/rest_api -k 'GET' -s - name: Creating a log file from cvat containers if: failure() @@ -192,7 +200,7 @@ jobs: while [[ $(curl -s -o /dev/null -w "%{http_code}" localhost:8181/health) != "200" && max_tries -gt 0 ]]; do (( max_tries-- )); sleep 5; done docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml run cvat_ci /bin/bash \ - -c 'python manage.py test cvat/apps cvat-cli -k tasks_id -k lambda -k share -v 2' + -c 'python manage.py test cvat/apps -k tasks_id -k lambda -k share -v 2' docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml run cvat_ci /bin/bash \ -c 'yarn --frozen-lockfile --ignore-scripts && yarn workspace cvat-core run test' diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index b80b2617..91359769 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -17,8 +17,7 @@ jobs: PR_FILES="$PR_FILES_AM $PR_FILES_RENAMED" for FILE in $PR_FILES; do EXTENSION="${FILE##*.}" - DIRECTORY="${FILE%%/*}" - if [[ "$EXTENSION" == 'py' && "$DIRECTORY" != 'cvat-sdk' ]]; then + if [[ "$EXTENSION" == 'py' ]]; then CHANGED_FILES+=" $FILE" fi done diff --git a/.github/workflows/schedule.yml b/.github/workflows/schedule.yml index be941f7c..5b82913d 100644 --- a/.github/workflows/schedule.yml +++ b/.github/workflows/schedule.yml @@ -222,12 +222,21 @@ jobs: chmod +x ./opa ./opa test cvat/apps/iam/rules - - name: REST API tests + - name: REST API and SDK tests run: | + docker run --rm -v ${PWD}/cvat-sdk/schema/:/transfer \ + --entrypoint /bin/bash -u root cvat/server \ + -c 'python manage.py spectacular --file /transfer/schema.yml' + pip3 install --user -r cvat-sdk/gen/requirements.txt + cd cvat-sdk/ + gen/generate.sh + cd .. + pip3 install --user cvat-sdk/ - pip3 install --user -r tests/rest_api/requirements.txt - pytest tests/rest_api/ - pytest tests/rest_api/ --stop-services + pip3 install --user cvat-cli/ + pip3 install --user -r tests/python/requirements.txt + pytest tests/python/ + pytest tests/python/ --stop-services - name: Unit tests env: @@ -239,7 +248,7 @@ jobs: while [[ $(curl -s -o /dev/null -w "%{http_code}" localhost:8181/health) != "200" && max_tries -gt 0 ]]; do (( max_tries-- )); sleep 5; done docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml run cvat_ci /bin/bash \ - -c 'coverage run -a manage.py test cvat/apps cvat-cli && mv .coverage ${CONTAINER_COVERAGE_DATA_DIR}' + -c 'coverage run -a manage.py test cvat/apps && mv .coverage ${CONTAINER_COVERAGE_DATA_DIR}' docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml run cvat_ci /bin/bash \ -c 'yarn --frozen-lockfile --ignore-scripts && yarn workspace cvat-core run test' diff --git a/.pylintrc b/.pylintrc index bea34764..63b2524e 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,505 +1,973 @@ -[MASTER] +[MAIN] + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Load and enable all available extensions. Use --list-extensions to see a list +# all available extensions. +#enable-all-extensions= + +# In error mode, messages with a category besides ERROR or FATAL are +# suppressed, and no reports are done by default. Error mode is compatible with +# disabling specific errors. +#errors-only= + +# Always return a 0 (non-error) status code, even if lint errors are found. +# This is primarily useful in continuous integration scripts. +#exit-zero= + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. +extension-pkg-allow-list= + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. (This is an alternative name to extension-pkg-allow-list +# for backward compatibility.) +extension-pkg-whitelist= + +# Return non-zero exit code if any of these messages/categories are detected, +# even if score is above --fail-under value. Syntax same as enable. Messages +# specified are enabled, while categories only check already-enabled messages. +fail-on= + +# Specify a score threshold to be exceeded before program exits with error. +fail-under=10 + +# Interpret the stdin as a python script, whose filename needs to be passed as +# the module_or_package argument. +#from-stdin= + +# Files or directories to be skipped. They should be base names, not paths. +ignore=CVS + +# Add files or directories matching the regex patterns to the ignore-list. The +# regex matches against paths and can be in Posix or Windows format. +ignore-paths= + cvat-sdk\\cvat_sdk\\api_client|cvat-sdk/cvat_sdk/api_client + +# Files or directories matching the regex patterns are skipped. The regex +# matches against base names, not paths. The default value ignores Emacs file +# locks +ignore-patterns= + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis). It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules= # Python code to execute, usually for sys.path manipulation such as # pygtk.require(). #init-hook= -# Add files or directories to the blacklist. They should be base names, not -# paths. -ignore=CVS +# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the +# number of processors available to use, and will cap the count on Windows to +# avoid hangs. +jobs=0 -# Add files or directories matching the regex patterns to the blacklist. The -# regex matches against base names, not paths. -ignore-patterns= +# Control the amount of potential inferred values when inferring a single +# object. This can help the performance when dealing with large functions or +# complex, nested conditions. +limit-inference-results=100 + +# List of plugins (as comma separated values of python module names) to load, +# usually to register additional checkers. +load-plugins=pylint_django # Pickle collected data for later comparisons. persistent=yes -# List of plugins (as comma separated values of python modules names) to load, -# usually to register additional checkers. -load-plugins=pylint_django +# Minimum Python version to use for version dependent checks. Will default to +# the version used to run pylint. +py-version=3.7 -# Use multiple processes to speed up Pylint. -jobs=0 +# Discover python modules and packages in the file system subtree. +recursive=no + +# When enabled, pylint would attempt to guess common misconfiguration and emit +# user-friendly hints instead of false-positive error messages. +suggestion-mode=yes # Allow loading of arbitrary C extensions. Extensions are imported into the # active Python interpreter and may run arbitrary code. unsafe-load-any-extension=no -# A comma-separated list of package or module names from where C extensions may -# be loaded. Extensions are loading into the active Python interpreter and may -# run arbitrary code -extension-pkg-whitelist= +# In verbose mode, extra non-checker-related info will be displayed. +#verbose= + + +[REPORTS] + +# Python expression which should return a score less than or equal to 10. You +# have access to the variables 'fatal', 'error', 'warning', 'refactor', +# 'convention', and 'info' which contain the number of messages in each +# category, as well as 'statement' which is the total number of statements +# analyzed. This score is used by the global evaluation report (RP0004). +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details. +msg-template= + +# Set the output format. Available formats are text, parseable, colorized, json +# and msvs (visual studio). You can also give a reporter class, e.g. +# mypackage.mymodule.MyReporterClass. +#output-format= + +# Tells whether to display a full report or only the messages. +reports=no + +# Activate the evaluation score. +score=yes [MESSAGES CONTROL] # Only show warnings with the listed confidence levels. Leave empty to show -# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED -confidence= +# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, +# UNDEFINED. +confidence=HIGH, + CONTROL_FLOW, + INFERENCE, + INFERENCE_FAILURE, + UNDEFINED # Disable the message, report, category or checker with the given id(s). You # can either give multiple identifiers separated by comma (,) or put this # option multiple times (only on the command line, not in the configuration -# file where it should appear only once).You can also use "--disable=all" to -# disable everything first and then reenable specific checks. For example, if +# file where it should appear only once). You can also use "--disable=all" to +# disable everything first and then re-enable specific checks. For example, if # you want to run only the similarities checker, you can use "--disable=all # --enable=similarities". If you want to run only the classes checker, but have -# no Warning level messages displayed, use"--disable=all --enable=classes -# --disable=W" -disable=all +# no Warning level messages displayed, use "--disable=all --enable=classes +# --disable=W". +disable=raw-checker-failed, + bad-inline-option, + locally-disabled, + file-ignored, + suppressed-message, + useless-suppression, + deprecated-pragma, + use-symbolic-message-instead, + c-extension-no-member, + invalid-name, + disallowed-name, + typevar-name-incorrect-variance, + typevar-double-variance, + typevar-name-mismatch, + empty-docstring, + missing-module-docstring, + missing-class-docstring, + missing-function-docstring, + non-ascii-name, + non-ascii-module-import, + line-too-long, + too-many-lines, + trailing-newlines, + multiple-statements, + mixed-line-endings, + unexpected-line-ending-format, + unnecessary-lambda-assignment, + unnecessary-direct-lambda-call, + unneeded-not, + consider-iterating-dictionary, + consider-using-dict-items, + use-maxsplit-arg, + use-sequence-for-iteration, + consider-using-f-string, + use-implicit-booleaness-not-len, + use-implicit-booleaness-not-comparison, + wrong-spelling-in-comment, + wrong-spelling-in-docstring, + invalid-characters-in-docstring, + bad-file-encoding, + multiple-imports, + wrong-import-order, + ungrouped-imports, + wrong-import-position, + useless-import-alias, + import-outside-toplevel, + bad-classmethod-argument, + bad-mcs-method-argument, + bad-mcs-classmethod-argument, + single-string-used-for-slots, + unnecessary-dunder-call, + useless-option-value, + literal-comparison, + comparison-with-itself, + comparison-of-constants, + too-many-ancestors, + too-many-instance-attributes, + too-few-public-methods, + too-many-public-methods, + too-many-return-statements, + too-many-branches, + too-many-arguments, + too-many-locals, + too-many-statements, + too-many-boolean-expressions, + consider-merging-isinstance, + too-many-nested-blocks, + redefined-argument-from-local, + no-else-return, + consider-using-ternary, + trailing-comma-tuple, + stop-iteration-return, + simplify-boolean-expression, + inconsistent-return-statements, + useless-return, + consider-swap-variables, + consider-using-join, + consider-using-in, + consider-using-get, + chained-comparison, + consider-using-dict-comprehension, + consider-using-set-comprehension, + simplifiable-if-expression, + no-else-raise, + unnecessary-comprehension, + consider-using-sys-exit, + no-else-break, + no-else-continue, + super-with-arguments, + simplifiable-condition, + condition-evals-to-constant, + consider-using-generator, + use-a-generator, + consider-using-min-builtin, + consider-using-max-builtin, + consider-using-with, + unnecessary-dict-index-lookup, + use-list-literal, + use-dict-literal, + unnecessary-list-index-lookup, + duplicate-code, + cyclic-import, + consider-using-from-import, + property-with-parameters, + http-response-with-json-dumps, + http-response-with-content-type-json, + redundant-content-type-for-json-response, + unknown-option-value, + eval-used, + using-constant-test, + missing-parentheses-for-call-in-test, + self-assigning-variable, + redeclared-assigned-name, + assert-on-string-literal, + duplicate-value, + comparison-with-callable, + nan-comparison, + non-ascii-file-name, + global-statement, + unused-argument, + unused-wildcard-import, + redefined-outer-name, + undefined-loop-variable, + unbalanced-tuple-unpacking, + cell-var-from-loop, + possibly-unused-variable, + self-cls-assignment, + using-f-string-in-unsupported-version, + using-final-decorator-in-unsupported-version, + unused-format-string-argument, + duplicate-string-formatting-argument, + f-string-without-interpolation, + format-string-without-interpolation, + implicit-str-concat, + inconsistent-quotes, + redundant-u-string-prefix, + fixme, + broad-except, + try-except-raise, + raise-missing-from, + raising-format-tuple, + wrong-exception-operation, + wildcard-import, + deprecated-module, + import-self, + preferred-module, + attribute-defined-outside-init, + bad-staticmethod-argument, + protected-access, + abstract-method, + super-init-not-called, + useless-super-delegation, + invalid-overridden-method, + arguments-renamed, + unused-private-member, + overridden-final-method, + subclassed-final-class, + redefined-slots-in-subclass, + super-without-brackets, + modified-iterating-list, + unnecessary-ellipsis, + bad-open-mode, + boolean-datetime, + redundant-unittest-assert, + deprecated-method, + bad-thread-instantiation, + shallow-copy-environ, + invalid-envvar-default, + subprocess-popen-preexec-fn, + subprocess-run-check, + deprecated-argument, + deprecated-class, + deprecated-decorator, + unspecified-encoding, + forgotten-debug-statement, + method-cache-max-size-none, + useless-with-lock, + keyword-arg-before-vararg, + arguments-out-of-order, + non-str-assignment-to-dunder-name, + isinstance-second-argument-not-valid-type, + logging-not-lazy, + logging-format-interpolation, + logging-fstring-interpolation, + model-missing-unicode, + model-has-unicode, + model-no-explicit-unicode, + django-not-available-placeholder, + modelform-uses-exclude, + unrecognized-inline-option, + bad-plugin-value, + bad-configuration-section, + unrecognized-option, + return-arg-in-generator, + used-prior-global-declaration, + bad-reversed-sequence, + misplaced-format-function, + invalid-all-format, + no-name-in-module, + unpacking-non-sequence, + potential-index-error, + bad-string-format-type, + bad-str-strip-call, + yield-inside-async-function, + not-async-context-manager, + invalid-unicode-codec, + bidirectional-unicode, + invalid-character-backspace, + invalid-character-carriage-return, + invalid-character-sub, + invalid-character-esc, + invalid-character-nul, + invalid-character-zero-width-space, + import-error, + relative-beyond-top-level, + no-self-argument, + assigning-non-slot, + class-variable-slots-conflict, + invalid-class-object, + invalid-enum-extension, + invalid-length-returned, + invalid-bool-returned, + invalid-index-returned, + invalid-repr-returned, + invalid-str-returned, + invalid-bytes-returned, + invalid-hash-returned, + invalid-length-hint-returned, + invalid-format-returned, + invalid-getnewargs-returned, + invalid-getnewargs-ex-returned, + modified-iterating-dict, + modified-iterating-set, + invalid-envvar-value, + no-member, + assignment-from-none, + not-context-manager, + invalid-unary-operand-type, + unsupported-binary-operation, + unsupported-membership-test, + unsubscriptable-object, + unsupported-assignment-operation, + unsupported-delete-operation, + invalid-metaclass, + unhashable-dict-key, + dict-iter-missing-items, + await-outside-async, + not-an-iterable, + not-a-mapping, + model-unicode-not-callable, + hard-coded-auth-user, + imported-auth-user, + django-not-configured, + fatal, + astroid-error, + parse-error, + config-parse-error, + method-check-failed, + django-not-available, + django-settings-module-not-found # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option # multiple time (only on the command line, not in the configuration file where # it should appear only once). See also the "--disable" option for examples. -enable= - C0121, # singleton-comparison - C0123, # unidiomatic-typecheck - C0200, # consider-using-enumerate - C0303, # trailing-whitespace - C0304, # missing-final-newline - C0325, # superfluous-parens - - E0001, # syntax-error - E0100, # init-is-generator - E0101, # return-in-init - E0102, # function-redefined - E0103, # not-in-loop - E0104, # return-outside-function - E0105, # yield-outside-function - E0107, # nonexistent-operator - E0108, # duplicate-argument-name - E0110, # abstract-class-instantiated - E0112, # too-many-star-expressions - E0113, # invalid-star-assignment-target - E0114, # star-needs-assignment-target - E0115, # nonlocal-and-global - E0116, # continue-in-finally - E0117, # nonlocal-without-binding - E0202, # method-hidden - E0203, # access-member-before-definition - E0211, # no-method-argument - E0236, # invalid-slots-object - E0238, # invalid-slots - E0239, # inherit-non-class - E0240, # inconsistent-mro - E0241, # duplicate-bases - E0301, # non-iterator-returned - E0302, # unexpected-special-method-signature - E0601, # used-before-assignment - E0602, # undefined-variable - E0603, # undefined-all-variable - E0604, # invalid-all-object - E0701, # bad-except-order - E0702, # raising-bad-type - E0703, # bad-exception-context - E0704, # misplaced-bare-raise - E0710, # raising-non-exception - E0711, # notimplemented-raised - E0712, # catching-non-exception - E1003, # bad-super-call - E1102, # not-callable - E1111, # assignment-from-no-return - E1120, # no-value-for-parameter - E1121, # too-many-function-args - E1123, # unexpected-keyword-arg - E1124, # redundant-keyword-arg - E1125, # missing-kwoa - E1126, # invalid-sequence-index - E1127, # invalid-slice-index - E1132, # repeated-keyword - E1200, # logging-unsupported-format - E1201, # logging-format-truncated - E1205, # logging-too-many-args - E1206, # logging-too-few-args - E1300, # bad-format-character - E1301, # truncated-format-string - E1302, # mixed-format-string - E1303, # format-needs-mapping - E1304, # missing-format-string-key - E1305, # too-many-format-args - E1306, # too-few-format-args - - R0202, # no-classmethod-decorator - R0203, # no-staticmethod-decorator - R0205, # useless-object-inheritance - R1703, # simplifiable-if-statement - - W0101, # unreachable - W0102, # dangerous-default-value - W0104, # pointless-statement - W0105, # pointless-string-statement - W0106, # expression-not-assigned - W0107, # unnecessary-pass - W0108, # unnecessary-lambda - W0109, # duplicate-key - W0120, # useless-else-on-loop - W0122, # exec-used - W0124, # confusing-with-statement - W0150, # lost-exception - W0199, # assert-on-tuple - W0221, # arguments-differ - W0222, # signature-differs - W0233, # non-parent-init-called - W0301, # unnecessary-semicolon - W0311, # bad-indentation - W0404, # reimported - W0410, # misplaced-future - W0601, # global-variable-undefined - W0602, # global-variable-not-assigned - W0604, # global-at-module-level - W0611, # unused-import - W0612, # unused-variable - W0622, # redefined-builtin - W0702, # bare-except - W0705, # duplicate-except - W0711, # binary-op-exception - W1300, # bad-format-string-key - W1301, # unused-format-string-key - W1302, # bad-format-string - W1303, # missing-format-argument-key - W1305, # format-combined-specification - W1306, # missing-format-attribute - W1307, # invalid-format-index - W1401, # anomalous-backslash-in-string - W1402, # anomalous-unicode-escape-in-string +enable=singleton-comparison, + unidiomatic-typecheck, + trailing-whitespace, + missing-final-newline, + superfluous-parens, + consider-using-enumerate, + simplifiable-if-statement, + no-classmethod-decorator, + no-staticmethod-decorator, + useless-object-inheritance, + useless-else-on-loop, + unreachable, + dangerous-default-value, + pointless-statement, + pointless-string-statement, + expression-not-assigned, + unnecessary-lambda, + duplicate-key, + exec-used, + confusing-with-statement, + lost-exception, + assert-on-tuple, + unnecessary-pass, + global-variable-undefined, + global-variable-not-assigned, + global-at-module-level, + unused-import, + unused-variable, + redefined-builtin, + unnecessary-semicolon, + bad-indentation, + bad-format-string-key, + unused-format-string-key, + bad-format-string, + missing-format-argument-key, + format-combined-specification, + missing-format-attribute, + invalid-format-index, + anomalous-backslash-in-string, + anomalous-unicode-escape-in-string, + bare-except, + duplicate-except, + binary-op-exception, + reimported, + misplaced-future, + arguments-differ, + signature-differs, + non-parent-init-called, + syntax-error, + init-is-generator, + return-in-init, + function-redefined, + not-in-loop, + return-outside-function, + yield-outside-function, + nonexistent-operator, + duplicate-argument-name, + abstract-class-instantiated, + too-many-star-expressions, + invalid-star-assignment-target, + star-needs-assignment-target, + nonlocal-and-global, + continue-in-finally, + nonlocal-without-binding, + used-before-assignment, + undefined-variable, + undefined-all-variable, + invalid-all-object, + bad-format-character, + truncated-format-string, + mixed-format-string, + format-needs-mapping, + missing-format-string-key, + too-many-format-args, + too-few-format-args, + bad-except-order, + raising-bad-type, + bad-exception-context, + misplaced-bare-raise, + raising-non-exception, + notimplemented-raised, + catching-non-exception, + method-hidden, + access-member-before-definition, + no-method-argument, + invalid-slots-object, + invalid-slots, + inherit-non-class, + inconsistent-mro, + duplicate-bases, + non-iterator-returned, + unexpected-special-method-signature, + bad-super-call, + not-callable, + assignment-from-no-return, + no-value-for-parameter, + too-many-function-args, + unexpected-keyword-arg, + redundant-keyword-arg, + missing-kwoa, + invalid-sequence-index, + invalid-slice-index, + repeated-keyword, + logging-unsupported-format, + logging-format-truncated, + logging-too-many-args, + logging-too-few-args -[REPORTS] +[BASIC] -# Set the output format. Available formats are text, parseable, colorized, msvs -# (visual studio) and html. You can also give a reporter class, eg -# mypackage.mymodule.MyReporterClass. -output-format=text +# Naming style matching correct argument names. +argument-naming-style=snake_case -# Put messages in a separate file for each module / package specified on the -# command line instead of printing them on stdout. Reports (if any) will be -# written in a file name "pylint_global.[txt|html]". This option is deprecated -# and it will be removed in Pylint 2.0. -files-output=no +# Regular expression matching correct argument names. Overrides argument- +# naming-style. If left empty, argument names will be checked with the set +# naming style. +argument-rgx=[a-z_][a-z0-9_]{2,30}$ -# Tells whether to display a full report or only the messages -reports=no +# Naming style matching correct attribute names. +attr-naming-style=snake_case -# Python expression which should return a note less than 10 (10 is the highest -# note). You have access to the variables errors warning, statement which -# respectively contain the number of errors / warnings messages and the total -# number of statements analyzed. This is used by the global evaluation report -# (RP0004). -evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) +# Regular expression matching correct attribute names. Overrides attr-naming- +# style. If left empty, attribute names will be checked with the set naming +# style. +attr-rgx=[a-z_][a-z0-9_]{2,30}$ -# Template used to display messages. This is a python new-style format string -# used to format the message information. See doc for all details -#msg-template= +# Bad variable names which should always be refused, separated by a comma. +bad-names=foo, + bar, + baz, + toto, + tutu, + tata +# Bad variable names regexes, separated by a comma. If names match any regex, +# they will always be refused +bad-names-rgxs= -[BASIC] +# Naming style matching correct class attribute names. +class-attribute-naming-style=any + +# Regular expression matching correct class attribute names. Overrides class- +# attribute-naming-style. If left empty, class attribute names will be checked +# with the set naming style. +class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ + +# Naming style matching correct class constant names. +class-const-naming-style=UPPER_CASE -# Good variable names which should always be accepted, separated by a comma -good-names=i,j,k,ex,Run,_ +# Regular expression matching correct class constant names. Overrides class- +# const-naming-style. If left empty, class constant names will be checked with +# the set naming style. +#class-const-rgx= -# Bad variable names which should always be refused, separated by a comma -bad-names=foo,bar,baz,toto,tutu,tata +# Naming style matching correct class names. +class-naming-style=PascalCase + +# Regular expression matching correct class names. Overrides class-naming- +# style. If left empty, class names will be checked with the set naming style. +class-rgx=[A-Z_][a-zA-Z0-9]+$ + +# Naming style matching correct constant names. +const-naming-style=UPPER_CASE + +# Regular expression matching correct constant names. Overrides const-naming- +# style. If left empty, constant names will be checked with the set naming +# style. +const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# Naming style matching correct function names. +function-naming-style=snake_case + +# Regular expression matching correct function names. Overrides function- +# naming-style. If left empty, function names will be checked with the set +# naming style. +function-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Good variable names which should always be accepted, separated by a comma. +good-names=i, + j, + k, + ex, + Run, + _ + +# Good variable names regexes, separated by a comma. If names match any regex, +# they will always be accepted +good-names-rgxs= + +# Include a hint for the correct naming format with invalid-name. +include-naming-hint=no + +# Naming style matching correct inline iteration names. +inlinevar-naming-style=any + +# Regular expression matching correct inline iteration names. Overrides +# inlinevar-naming-style. If left empty, inline iteration names will be checked +# with the set naming style. +inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ + +# Naming style matching correct method names. +method-naming-style=snake_case + +# Regular expression matching correct method names. Overrides method-naming- +# style. If left empty, method names will be checked with the set naming style. +method-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Naming style matching correct module names. +module-naming-style=snake_case + +# Regular expression matching correct module names. Overrides module-naming- +# style. If left empty, module names will be checked with the set naming style. +module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ # Colon-delimited sets of names that determine each other's naming style when # the name regexes allow several styles. name-group= -# Include a hint for the correct naming format with invalid-name -include-naming-hint=no +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ # List of decorators that produce properties, such as abc.abstractproperty. Add # to this list to register other decorators that produce valid properties. +# These decorators are taken in consideration only for invalid-name. property-classes=abc.abstractproperty -# Regular expression matching correct constant names -const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ +# Regular expression matching correct type variable names. If left empty, type +# variable names will be checked with the set naming style. +#typevar-rgx= -# Naming hint for constant names -const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$ +# Naming style matching correct variable names. +variable-naming-style=snake_case -# Regular expression matching correct class names -class-rgx=[A-Z_][a-zA-Z0-9]+$ +# Regular expression matching correct variable names. Overrides variable- +# naming-style. If left empty, variable names will be checked with the set +# naming style. +variable-rgx=[a-z_][a-z0-9_]{2,30}$ -# Naming hint for class names -class-name-hint=[A-Z_][a-zA-Z0-9]+$ -# Regular expression matching correct argument names -argument-rgx=[a-z_][a-z0-9_]{2,30}$ +[VARIABLES] -# Naming hint for argument names -argument-name-hint=[a-z_][a-z0-9_]{2,30}$ +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid defining new builtins when possible. +additional-builtins= -# Regular expression matching correct variable names -variable-rgx=[a-z_][a-z0-9_]{2,30}$ +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes -# Naming hint for variable names -variable-name-hint=[a-z_][a-z0-9_]{2,30}$ +# List of names allowed to shadow builtins +allowed-redefined-builtins= -# Regular expression matching correct class attribute names -class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_, + _cb -# Naming hint for class attribute names -class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ +# A regular expression matching the name of dummy variables (i.e. expected to +# not be used). +dummy-variables-rgx=(_+[a-zA-Z0-9]*?$)|dummy -# Regular expression matching correct method names -method-rgx=[a-z_][a-z0-9_]{2,30}$ +# Argument names that match this expression will be ignored. Default to name +# with leading underscore. +ignored-argument-names=_.* -# Naming hint for method names -method-name-hint=[a-z_][a-z0-9_]{2,30}$ +# Tells whether we should check for unused import in __init__ files. +init-import=no -# Regular expression matching correct module names -module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,future.builtins -# Naming hint for module names -module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ -# Regular expression matching correct function names -function-rgx=[a-z_][a-z0-9_]{2,30}$ +[DESIGN] -# Naming hint for function names -function-name-hint=[a-z_][a-z0-9_]{2,30}$ +# List of regular expressions of class ancestor names to ignore when counting +# public methods (see R0903) +exclude-too-few-public-methods= -# Regular expression matching correct attribute names -attr-rgx=[a-z_][a-z0-9_]{2,30}$ +# List of qualified class names to ignore when counting class parents (see +# R0901) +ignored-parents= -# Naming hint for attribute names -attr-name-hint=[a-z_][a-z0-9_]{2,30}$ +# Maximum number of arguments for function / method. +max-args=5 -# Regular expression matching correct inline iteration names -inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ +# Maximum number of attributes for a class (see R0902). +max-attributes=7 -# Naming hint for inline iteration names -inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$ +# Maximum number of boolean expressions in an if statement (see R0916). +max-bool-expr=5 -# Regular expression which should only match function or class names that do -# not require a docstring. -no-docstring-rgx=^_ +# Maximum number of branch for function / method body. +max-branches=12 -# Minimum line length for functions/classes that require docstrings, shorter -# ones are exempt. -docstring-min-length=-1 +# Maximum number of locals for function / method body. +max-locals=15 +# Maximum number of parents for a class (see R0901). +max-parents=7 -[ELIF] +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 -# Maximum number of nested blocks for function / method body -max-nested-blocks=5 +# Maximum number of return / yield for function / method body. +max-returns=6 + +# Maximum number of statements in function / method body. +max-statements=50 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 [FORMAT] -# Maximum number of characters on a single line. -max-line-length=100 +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= # Regexp for a line that is allowed to be longer than the limit. ignore-long-lines=^\s*(# )??$ -# Allow the body of an if to be on the same line as the test if there is no -# else. -single-line-if-stmt=no - -# List of optional constructs for which whitespace checking is disabled. `dict- -# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. -# `trailing-comma` allows a space between comma and closing bracket: (a, ). -# `empty-line` allows space-only lines. -no-space-check=trailing-comma,dict-separator - -# Maximum number of lines in a module -max-module-lines=1000 +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 # tab). indent-string=' ' -# Number of spaces of indent required inside a hanging or continued line. -indent-after-paren=4 +# Maximum number of characters on a single line. +max-line-length=100 -# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. -expected-line-ending-format= +# Maximum number of lines in a module. +max-module-lines=1000 +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no -[LOGGING] +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no -# Logging modules to check that the string format arguments are in logging -# function parameter format -logging-modules=logging + +[STRING] + +# This flag controls whether inconsistent-quotes generates a warning when the +# character used as a quote delimiter is used inconsistently within a module. +check-quote-consistency=no + +# This flag controls whether the implicit-str-concat should generate a warning +# on implicit string concatenation in sequences defined over several lines. +check-str-concat-over-line-jumps=no [MISCELLANEOUS] # List of note tags to take in consideration, separated by a comma. -notes=FIXME,XXX,TODO +notes=FIXME, + XXX, + TODO +# Regular expression of note tags to take in consideration. +notes-rgx= -[SIMILARITIES] -# Minimum lines number of a similarity. -min-similarity-lines=4 - -# Ignore comments when computing similarities. -ignore-comments=yes +[REFACTORING] -# Ignore docstrings when computing similarities. -ignore-docstrings=yes +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 -# Ignore imports when computing similarities. -ignore-imports=no +# Complete name of functions that never returns. When checking for +# inconsistent-return-statements if a never returning function is called then +# it will be considered as an explicit return statement and no message will be +# printed. +never-returning-functions=sys.exit,argparse.parse_error [SPELLING] -# Spelling dictionary name. Available dictionaries: none. To make it working -# install python-enchant package. +# Limits count of emitted suggestions for spelling mistakes. +max-spelling-suggestions=4 + +# Spelling dictionary name. Available dictionaries: none. To make it work, +# install the 'python-enchant' package. spelling-dict= +# List of comma separated words that should be considered directives if they +# appear at the beginning of a comment and should not be checked. +spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy: + # List of comma separated words that should not be checked. spelling-ignore-words= -# A path to a file that contains private dictionary; one word per line. +# A path to a file that contains the private dictionary; one word per line. spelling-private-dict-file= -# Tells whether to store unknown words to indicated private dictionary in -# --spelling-private-dict-file option instead of raising a message. +# Tells whether to store unknown words to the private dictionary (see the +# --spelling-private-dict-file option) instead of raising a message. spelling-store-unknown-words=no -[TYPECHECK] +[SIMILARITIES] -# Tells whether missing members accessed in mixin class should be ignored. A -# mixin class is detected if its name ends with "mixin" (case insensitive). -ignore-mixin-members=yes +# Comments are removed from the similarity computation +ignore-comments=yes -# List of module names for which member attributes should not be checked -# (useful for modules/projects where namespaces are manipulated during runtime -# and thus existing member attributes cannot be deduced by static analysis. It -# supports qualified module names, as well as Unix pattern matching. -ignored-modules= +# Docstrings are removed from the similarity computation +ignore-docstrings=yes -# List of class names for which member attributes should not be checked (useful -# for classes with dynamically set attributes). This supports the use of -# qualified names. -ignored-classes=optparse.Values,thread._local,_thread._local +# Imports are removed from the similarity computation +ignore-imports=no -# List of members which are set dynamically and missed by pylint inference -# system, and so shouldn't trigger E1101 when accessed. Python regular -# expressions are accepted. -generated-members= +# Signatures are removed from the similarity computation +ignore-signatures=yes -# List of decorators that produce context managers, such as -# contextlib.contextmanager. Add to this list to register other decorators that -# produce valid context managers. -contextmanager-decorators=contextlib.contextmanager +# Minimum lines number of a similarity. +min-similarity-lines=4 -[VARIABLES] +[EXCEPTIONS] -# Tells whether we should check for unused import in __init__ files. -init-import=no +# Exceptions that will emit a warning when caught. +overgeneral-exceptions=Exception -# A regular expression matching the name of dummy variables (i.e. expectedly -# not used). -dummy-variables-rgx=(_+[a-zA-Z0-9]*?$)|dummy -# List of additional names supposed to be defined in builtins. Remember that -# you should avoid to define new builtins when possible. -additional-builtins= +[IMPORTS] -# List of strings which can identify a callback function by name. A callback -# name must start or end with one of those strings. -callbacks=cb_,_cb +# List of modules that can be imported at any level, not just the top level +# one. +allow-any-import-level= -# List of qualified module names which can have objects that can redefine -# builtins. -redefining-builtins-modules=six.moves,future.builtins +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no +# Deprecated modules which should not be used, separated by a comma. +deprecated-modules=optparse -[CLASSES] +# Output a graph (.gv or any supported image format) of external dependencies +# to the given file (report RP0402 must not be disabled). +ext-import-graph= -# List of method names used to declare (i.e. assign) instance attributes. -defining-attr-methods=__init__,__new__,setUp +# Output a graph (.gv or any supported image format) of all (i.e. internal and +# external) dependencies to the given file (report RP0402 must not be +# disabled). +import-graph= -# List of valid names for the first argument in a class method. -valid-classmethod-first-arg=cls +# Output a graph (.gv or any supported image format) of internal dependencies +# to the given file (report RP0402 must not be disabled). +int-import-graph= -# List of valid names for the first argument in a metaclass class method. -valid-metaclass-classmethod-first-arg=mcs +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= -# List of member names, which should be excluded from the protected access -# warning. -exclude-protected=_asdict,_fields,_replace,_source,_make +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant +# Couples of modules and preferred modules, separated by a comma. +preferred-modules= -[DESIGN] -# Maximum number of arguments for function / method -max-args=5 +[CLASSES] -# Argument names that match this expression will be ignored. Default to name -# with leading underscore -ignored-argument-names=_.* +# Warn about protected attribute access inside special methods +check-protected-access-in-special-methods=no -# Maximum number of locals for function / method body -max-locals=15 +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__, + __new__, + setUp -# Maximum number of return / yield for function / method body -max-returns=6 +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict, + _fields, + _replace, + _source, + _make -# Maximum number of branch for function / method body -max-branches=12 +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls -# Maximum number of statements in function / method body -max-statements=50 +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs -# Maximum number of parents for a class (see R0901). -max-parents=7 -# Maximum number of attributes for a class (see R0902). -max-attributes=7 +[TYPECHECK] -# Minimum number of public methods for a class (see R0903). -min-public-methods=2 +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager -# Maximum number of public methods for a class (see R0904). -max-public-methods=20 +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= -# Maximum number of boolean expressions in a if statement -max-bool-expr=5 +# Tells whether to warn about missing members when the owner of the attribute +# is inferred to be None. +ignore-none=yes +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes -[IMPORTS] +# List of symbolic message names to ignore for Mixin members. +ignored-checks-for-mixins=no-member, + not-async-context-manager, + not-context-manager, + attribute-defined-outside-init -# Deprecated modules which should not be used, separated by a comma -deprecated-modules=optparse +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local -# Create a graph of every (i.e. internal and external) dependencies in the -# given file (report RP0402 must not be disabled) -import-graph= +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes -# Create a graph of external dependencies in the given file (report RP0402 must -# not be disabled) -ext-import-graph= +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 -# Create a graph of internal dependencies in the given file (report RP0402 must -# not be disabled) -int-import-graph= +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 -# Force import order to recognize a module as part of the standard -# compatibility libraries. -known-standard-library= +# Regex pattern to define which classes are considered mixins. +mixin-class-rgx=.*[Mm]ixin -# Force import order to recognize a module as part of a third party library. -known-third-party=enchant +# List of decorators that change the signature of a decorated function. +signature-mutators= -# Analyse import fallback blocks. This can be used to support both Python 2 and -# 3 compatible code, which means that the block might have code that exists -# only in one or another interpreter, leading to false positives when analysed. -analyse-fallback-blocks=no +[LOGGING] -[EXCEPTIONS] +# The type of string formatting that logging methods do. `old` means using % +# formatting, `new` is for `{}` formatting. +logging-format-style=old -# Exceptions that will emit a warning when being caught. Defaults to -# "Exception" -overgeneral-exceptions=Exception +# Logging modules to check that the string format arguments are in logging +# function parameter format. +logging-modules=logging + + +[DJANGO FOREIGN KEYS REFERENCED BY STRINGS] + +# A module containing Django settings to be used while linting. +#django-settings-module= diff --git a/.remarkignore b/.remarkignore index bf90f8a1..4f1b9bbf 100644 --- a/.remarkignore +++ b/.remarkignore @@ -1,2 +1,2 @@ cvat-sdk/docs/ -cvat-sdk/README.md \ No newline at end of file +cvat-sdk/README.md diff --git a/.vscode/launch.json b/.vscode/launch.json index 1812710e..c5bb8701 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -185,7 +185,35 @@ "python": "${command:python.interpreterPath}", "module": "pytest", "args": [ - "tests/rest_api/" + "tests/python/rest_api/" + ], + "cwd": "${workspaceFolder}", + "console": "integratedTerminal" + }, + { + "name": "sdk: tests", + "type": "python", + "request": "launch", + "justMyCode": false, + "stopOnEntry": false, + "python": "${command:python.interpreterPath}", + "module": "pytest", + "args": [ + "tests/python/sdk/" + ], + "cwd": "${workspaceFolder}", + "console": "integratedTerminal" + }, + { + "name": "cli: tests", + "type": "python", + "request": "launch", + "justMyCode": false, + "stopOnEntry": false, + "python": "${command:python.interpreterPath}", + "module": "pytest", + "args": [ + "tests/python/cli/" ], "cwd": "${workspaceFolder}", "console": "integratedTerminal" diff --git a/Dockerfile.ci b/Dockerfile.ci index 5a3c51e1..ab01eb72 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -23,11 +23,8 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/*; COPY cvat/requirements/ /tmp/cvat/requirements/ -COPY cvat-cli ${HOME}/cvat-cli RUN DATUMARO_HEADLESS=1 python3 -m pip install --no-cache-dir -r /tmp/cvat/requirements/${DJANGO_CONFIGURATION}.txt && \ - python3 -m pip install --no-cache-dir -r ${HOME}/cvat-cli/requirements/testing.txt && \ - python3 -m pip install --no-cache-dir ${HOME}/cvat-cli && \ python3 -m pip install --no-cache-dir coveralls RUN gem install coveralls-lcov diff --git a/cvat-cli/.gitignore b/cvat-cli/.gitignore new file mode 100644 index 00000000..43995bd4 --- /dev/null +++ b/cvat-cli/.gitignore @@ -0,0 +1,66 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.venv/ +.python-version +.pytest_cache + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/cvat-cli/pyproject.toml b/cvat-cli/pyproject.toml index 9927dd69..67280a49 100644 --- a/cvat-cli/pyproject.toml +++ b/cvat-cli/pyproject.toml @@ -6,7 +6,10 @@ build-backend = "setuptools.build_meta" profile = "black" forced_separate = ["tests"] line_length = 100 +skip_gitignore = true # align tool behavior with Black +# Can't just use a pyproject in the root dir, so duplicate +# https://github.com/psf/black/issues/2863 [tool.black] line-length = 100 target-version = ['py38'] diff --git a/cvat-cli/requirements/base.txt b/cvat-cli/requirements/base.txt index 945b4ee7..453c1821 100644 --- a/cvat-cli/requirements/base.txt +++ b/cvat-cli/requirements/base.txt @@ -1,4 +1,2 @@ +cvat-sdk==2.0 Pillow>=6.2.0 -requests>=2.20.1 -tuspy==0.2.5 -tqdm>=4.64.0 diff --git a/cvat-cli/requirements/testing.txt b/cvat-cli/requirements/testing.txt deleted file mode 100644 index ed69e1b5..00000000 --- a/cvat-cli/requirements/testing.txt +++ /dev/null @@ -1,4 +0,0 @@ --r base.txt - -# We depend on the server in the tests --r ../../cvat/requirements/testing.txt diff --git a/cvat-cli/src/cvat_cli/__init__.py b/cvat-cli/src/cvat_cli/__init__.py index eed40849..e69de29b 100644 --- a/cvat-cli/src/cvat_cli/__init__.py +++ b/cvat-cli/src/cvat_cli/__init__.py @@ -1,3 +0,0 @@ -# Copyright (C) 2020-2022 Intel Corporation -# -# SPDX-License-Identifier: MIT diff --git a/cvat-cli/src/cvat_cli/__main__.py b/cvat-cli/src/cvat_cli/__main__.py index 8afeeba2..0ac29d5e 100755 --- a/cvat-cli/src/cvat_cli/__main__.py +++ b/cvat-cli/src/cvat_cli/__main__.py @@ -1,56 +1,58 @@ # Copyright (C) 2020-2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation # # SPDX-License-Identifier: MIT import logging import sys from http.client import HTTPConnection +from typing import List -import requests +from cvat_sdk import exceptions, make_client -from cvat_cli.core.core import CLI, CVAT_API_V2 -from cvat_cli.core.definition import parser +from cvat_cli.cli import CLI +from cvat_cli.parser import get_action_args, make_cmdline_parser -log = logging.getLogger(__name__) +logger = logging.getLogger(__name__) -def config_log(level): - log = logging.getLogger("core") +def configure_logger(level): formatter = logging.Formatter( "[%(asctime)s] %(levelname)s: %(message)s", datefmt="%Y-%m-%d %H:%M:%S", style="%" ) handler = logging.StreamHandler(sys.stdout) handler.setFormatter(formatter) - log.addHandler(handler) - log.setLevel(level) + logger.addHandler(handler) + logger.setLevel(level) if level <= logging.DEBUG: HTTPConnection.debuglevel = 1 -def main(): +def main(args: List[str] = None): actions = { "create": CLI.tasks_create, "delete": CLI.tasks_delete, "ls": CLI.tasks_list, - "frames": CLI.tasks_frame, + "frames": CLI.tasks_frames, "dump": CLI.tasks_dump, "upload": CLI.tasks_upload, "export": CLI.tasks_export, "import": CLI.tasks_import, } - args = parser.parse_args() - config_log(args.loglevel) - with requests.Session() as session: - api = CVAT_API_V2("%s:%s" % (args.server_host, args.server_port), args.https) - cli = CLI(session, api, args.auth) + parser = make_cmdline_parser() + parsed_args = parser.parse_args(args) + configure_logger(parsed_args.loglevel) + + with make_client(parsed_args.server_host, port=parsed_args.server_port) as client: + client.logger = logger + + action_args = get_action_args(parser, parsed_args) try: - actions[args.action](cli, **args.__dict__) - except ( - requests.exceptions.HTTPError, - requests.exceptions.ConnectionError, - requests.exceptions.RequestException, - ) as e: - log.critical(e) + cli = CLI(client=client, credentials=parsed_args.auth) + actions[parsed_args.action](cli, **vars(action_args)) + except exceptions.ApiException as e: + logger.critical(e) + return 1 return 0 diff --git a/cvat-cli/src/cvat_cli/cli.py b/cvat-cli/src/cvat_cli/cli.py new file mode 100644 index 00000000..1a20ea3f --- /dev/null +++ b/cvat-cli/src/cvat_cli/cli.py @@ -0,0 +1,137 @@ +# Copyright (C) 2020-2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +from __future__ import annotations + +import json +from typing import Dict, List, Sequence, Tuple + +import tqdm +from cvat_sdk import Client, models +from cvat_sdk.core.helpers import TqdmProgressReporter +from cvat_sdk.core.types import ResourceType + + +class CLI: + def __init__(self, client: Client, credentials: Tuple[str, str]): + self.client = client + + # allow arbitrary kwargs in models + # TODO: will silently ignore invalid args, so remove this ASAP + self.client.api.configuration.discard_unknown_keys = True + + self.client.login(credentials) + + def tasks_list(self, *, use_json_output: bool = False, **kwargs): + """List all tasks in either basic or JSON format.""" + results = self.client.list_tasks(return_json=use_json_output, **kwargs) + if use_json_output: + print(json.dumps(json.loads(results), indent=2)) + else: + for r in results: + print(r.id) + + def tasks_create( + self, + name: str, + labels: List[Dict[str, str]], + resource_type: ResourceType, + resources: Sequence[str], + *, + annotation_path: str = "", + annotation_format: str = "CVAT XML 1.1", + status_check_period: int = 2, + dataset_repository_url: str = "", + lfs: bool = False, + **kwargs, + ) -> None: + """ + Create a new task with the given name and labels JSON and add the files to it. + """ + task = self.client.create_task( + spec=models.TaskWriteRequest(name=name, labels=labels, **kwargs), + resource_type=resource_type, + resources=resources, + data_params=kwargs, + annotation_path=annotation_path, + annotation_format=annotation_format, + status_check_period=status_check_period, + dataset_repository_url=dataset_repository_url, + use_lfs=lfs, + pbar=self._make_pbar(), + ) + print("Created task id", task.id) + + def tasks_delete(self, task_ids: Sequence[int]) -> None: + """Delete a list of tasks, ignoring those which don't exist.""" + self.client.delete_tasks(task_ids=task_ids) + + def tasks_frames( + self, + task_id: int, + frame_ids: Sequence[int], + *, + outdir: str = "", + quality: str = "original", + ) -> None: + """ + Download the requested frame numbers for a task and save images as + task__frame_.jpg. + """ + self.client.retrieve_task(task_id=task_id).download_frames( + frame_ids=frame_ids, + outdir=outdir, + quality=quality, + filename_pattern="task_{task_id}_frame_{frame_id:06d}{frame_ext}", + ) + + def tasks_dump( + self, + task_id: int, + fileformat: str, + filename: str, + *, + status_check_period: int = 2, + include_images: bool = False, + ) -> None: + """ + Download annotations for a task in the specified format (e.g. 'YOLO ZIP 1.0'). + """ + self.client.retrieve_task(task_id=task_id).export_dataset( + format_name=fileformat, + filename=filename, + pbar=self._make_pbar(), + status_check_period=status_check_period, + include_images=include_images, + ) + + def tasks_upload( + self, task_id: str, fileformat: str, filename: str, *, status_check_period: int = 2 + ) -> None: + """Upload annotations for a task in the specified format + (e.g. 'YOLO ZIP 1.0').""" + self.client.retrieve_task(task_id=task_id).import_annotations( + format_name=fileformat, + filename=filename, + status_check_period=status_check_period, + pbar=self._make_pbar(), + ) + + def tasks_export(self, task_id: str, filename: str, *, status_check_period: int = 2) -> None: + """Download a task backup""" + self.client.retrieve_task(task_id=task_id).download_backup( + filename=filename, status_check_period=status_check_period, pbar=self._make_pbar() + ) + + def tasks_import(self, filename: str, *, status_check_period: int = 2) -> None: + """Import a task from a backup file""" + self.client.create_task_from_backup( + filename=filename, status_check_period=status_check_period, pbar=self._make_pbar() + ) + + def _make_pbar(self, title: str = None) -> TqdmProgressReporter: + return TqdmProgressReporter( + tqdm.tqdm(unit_scale=True, unit="B", unit_divisor=1024, desc=title) + ) diff --git a/cvat-cli/src/cvat_cli/core/__init__.py b/cvat-cli/src/cvat_cli/core/__init__.py deleted file mode 100644 index ee9f69c0..00000000 --- a/cvat-cli/src/cvat_cli/core/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (C) 2020-2022 Intel Corporation -# -# SPDX-License-Identifier: MIT - -from .core import CLI, CVAT_API_V2 # noqa -from .definition import ResourceType, parser # noqa diff --git a/cvat-cli/src/cvat_cli/core/core.py b/cvat-cli/src/cvat_cli/core/core.py deleted file mode 100644 index 8f17ebe7..00000000 --- a/cvat-cli/src/cvat_cli/core/core.py +++ /dev/null @@ -1,591 +0,0 @@ -# Copyright (C) 2020-2022 Intel Corporation -# -# SPDX-License-Identifier: MIT - -from __future__ import annotations - -import json -import logging -import mimetypes -import os -import os.path as osp -from contextlib import ExitStack, closing -from io import BytesIO -from time import sleep -from typing import Dict, List, Optional, Sequence, Tuple - -import requests -import tqdm -from PIL import Image -from tusclient import client, uploader -from tusclient.request import TusRequest, TusUploadFailed - -from .definition import ResourceType -from .utils import StreamWithProgress, expect_status - -log = logging.getLogger(__name__) - - -class CLI: - def __init__(self, session: requests.Session, api: CVAT_API_V2, credentials: Tuple[str, str]): - self.api = api - self.session = session - self.login(credentials) - - def tasks_data( - self, - task_id: int, - resource_type: ResourceType, - resources: Sequence[str], - *, - pbar: tqdm.tqdm = None, - **kwargs, - ) -> None: - """Add local, remote, or shared files to an existing task.""" - url = self.api.tasks_id_data(task_id) - data = {} - - if resource_type == ResourceType.LOCAL: - bulk_files: Dict[str, int] = {} - separate_files: Dict[str, int] = {} - - MAX_REQUEST_SIZE = 100 * 2**20 - - for filename in resources: - filename = os.path.abspath(filename) - file_size = os.stat(filename).st_size - if MAX_REQUEST_SIZE < file_size: - separate_files[filename] = file_size - else: - bulk_files[filename] = file_size - - total_size = sum(bulk_files.values()) + sum(separate_files.values()) - - # split files by requests - bulk_file_groups = [] - current_group_size = 0 - current_group = [] - for filename, file_size in bulk_files.items(): - if MAX_REQUEST_SIZE < current_group_size + file_size: - bulk_file_groups.append((current_group, current_group_size)) - current_group_size = 0 - current_group = [] - - current_group.append(filename) - current_group_size += file_size - if current_group: - bulk_file_groups.append((current_group, current_group_size)) - elif resource_type == ResourceType.REMOTE: - data = {"remote_files[{}]".format(i): f for i, f in enumerate(resources)} - elif resource_type == ResourceType.SHARE: - data = {"server_files[{}]".format(i): f for i, f in enumerate(resources)} - - data["image_quality"] = 70 - - ## capture additional kwargs - for flag in [ - "chunk_size", - "copy_data", - "image_quality", - "sorting_method", - "start_frame", - "stop_frame", - "use_cache", - "use_zip_chunks", - ]: - if kwargs.get(flag) is not None: - data[flag] = kwargs.get(flag) - if kwargs.get("frame_step") is not None: - data["frame_filter"] = f"step={kwargs.get('frame_step')}" - - if resource_type in [ResourceType.REMOTE, ResourceType.SHARE]: - response = self.session.post(url, data=data) - response.raise_for_status() - elif resource_type == ResourceType.LOCAL: - if pbar is None: - pbar = self._make_pbar("Uploading files...") - - if pbar is not None: - pbar.reset(total_size) - - self._tus_start_upload(url) - - for group, group_size in bulk_file_groups: - with ExitStack() as es: - group_files = {} - for i, filename in enumerate(group): - group_files[f"client_files[{i}]"] = ( - filename, - es.enter_context(closing(open(filename, "rb"))), - ) - response = self.session.post( - url, data=data, files=group_files, headers={"Upload-Multiple": ""} - ) - expect_status(200, response) - - if pbar is not None: - pbar.update(group_size) - - for filename in separate_files: - self._upload_file_with_tus(url, filename, pbar=pbar, logger=log.debug) - - self._tus_finish_upload(url, data=data) - - def tasks_list(self, use_json_output, **kwargs): - """List all tasks in either basic or JSON format.""" - url = self.api.tasks - response = self.session.get(url) - response.raise_for_status() - output = [] - page = 1 - json_data_list = [] - while True: - response_json = response.json() - output += response_json["results"] - for r in response_json["results"]: - if use_json_output: - json_data_list.append(r) - else: - log.info("{id},{name},{status}".format(**r)) - if not response_json["next"]: - log.info(json.dumps(json_data_list, indent=4)) - return output - page += 1 - url = self.api.tasks_page(page) - response = self.session.get(url) - response.raise_for_status() - return output - - def tasks_create( - self, - name: str, - labels: List[Dict[str, str]], - resource_type: ResourceType, - resources: Sequence[str], - *, - annotation_path="", - annotation_format="CVAT XML 1.1", - completion_verification_period=20, - git_completion_verification_period=2, - dataset_repository_url="", - lfs=False, - pbar: tqdm.tqdm = None, - **kwargs, - ) -> int: - """ - Create a new task with the given name and labels JSON and - add the files to it. - - Returns: id of the created task - """ - - url = self.api.tasks - labels = [] if kwargs.get("project_id") is not None else labels - data = {"name": name, "labels": labels} - - for flag in ["bug_tracker", "overlap", "project_id", "segment_size"]: - if kwargs.get(flag) is not None: - data[flag] = kwargs.get(flag) - - response = self.session.post(url, json=data) - response.raise_for_status() - response_json = response.json() - log.info("Created task ID: {id} NAME: {name}".format(**response_json)) - - task_id = response_json["id"] - assert isinstance(task_id, int) - self.tasks_data(task_id, resource_type, resources, pbar=pbar, **kwargs) - - if annotation_path != "": - url = self.api.tasks_id_status(task_id) - response = self.session.get(url) - response_json = response.json() - - log.info("Awaiting data compression before uploading annotations...") - while response_json["state"] != "Finished": - sleep(completion_verification_period) - response = self.session.get(url) - response_json = response.json() - logger_string = """Awaiting compression for task {}. - Status={}, Message={}""".format( - task_id, response_json["state"], response_json["message"] - ) - log.info(logger_string) - - self.tasks_upload(task_id, annotation_format, annotation_path, pbar=pbar, **kwargs) - - if dataset_repository_url: - response = self.session.post( - self.api.git_create(task_id), - json={"path": dataset_repository_url, "lfs": lfs, "tid": task_id}, - ) - response_json = response.json() - rq_id = response_json["rq_id"] - log.info(f"Create RQ ID: {rq_id}") - check_url = self.api.git_check(rq_id) - response = self.session.get(check_url) - response_json = response.json() - while response_json["status"] != "finished": - log.info( - """Awaiting a dataset repository to be created for the task. Response status: {}""".format( - response_json["status"] - ) - ) - sleep(git_completion_verification_period) - response = self.session.get(check_url) - response_json = response.json() - if response_json["status"] == "failed" or response_json["status"] == "unknown": - log.error( - f"Dataset repository creation request for task {task_id} failed" - f'with status {response_json["status"]}.' - ) - break - - log.info( - f"Dataset repository creation completed with status: {response_json['status']}." - ) - - return task_id - - def tasks_delete(self, task_ids, **kwargs): - """Delete a list of tasks, ignoring those which don't exist.""" - for task_id in task_ids: - url = self.api.tasks_id(task_id) - response = self.session.delete(url) - try: - response.raise_for_status() - log.info("Task ID {} deleted".format(task_id)) - except requests.exceptions.HTTPError as e: - if response.status_code == 404: - log.info("Task ID {} not found".format(task_id)) - else: - raise e - - def tasks_frame(self, task_id, frame_ids, outdir="", quality="original", **kwargs): - """Download the requested frame numbers for a task and save images as - task__frame_.jpg.""" - for frame_id in frame_ids: - url = self.api.tasks_id_frame_id(task_id, frame_id, quality) - response = self.session.get(url) - response.raise_for_status() - im = Image.open(BytesIO(response.content)) - mime_type = im.get_format_mimetype() or "image/jpg" - im_ext = mimetypes.guess_extension(mime_type) - # FIXME It is better to use meta information from the server - # to determine the extension - # replace '.jpe' or '.jpeg' with a more used '.jpg' - if im_ext in (".jpe", ".jpeg", None): - im_ext = ".jpg" - - outfile = "task_{}_frame_{:06d}{}".format(task_id, frame_id, im_ext) - im.save(os.path.join(outdir, outfile)) - - def tasks_dump( - self, task_id, fileformat, filename, *, pbar=None, completion_check_period=2, **kwargs - ) -> None: - """ - Download annotations for a task in the specified format (e.g. 'YOLO ZIP 1.0'). - """ - - url = self.api.tasks_id(task_id) - response = self.session.get(url) - response.raise_for_status() - response_json = response.json() - - url = self.api.tasks_id_annotations_filename(task_id, response_json["name"], fileformat) - - log.info("Waiting for the server to prepare the file...") - - while True: - response = self.session.get(url) - response.raise_for_status() - log.info("STATUS {}".format(response.status_code)) - if response.status_code == 201: - break - sleep(completion_check_period) - - if pbar is None: - pbar = self._make_pbar("Downloading") - self._download_file(url + "&action=download", output_path=filename, pbar=pbar) - - log.info(f"Annotations have been exported to {filename}") - - def _make_tus_uploader(cli, url, **kwargs): - # Adjusts the library code for CVAT server - # allows to reuse session - class MyTusUploader(client.Uploader): - def __init__(self, *_args, session: requests.Session = None, **_kwargs): - self._session = session - super().__init__(*_args, **_kwargs) - - def _do_request(self): - self.request = TusRequest(self) - self.request.handle = self._session - try: - self.request.perform() - self.verify_upload() - except TusUploadFailed as error: - self._retry_or_cry(error) - - @uploader._catch_requests_error - def create_url(self): - """ - Return upload url. - - Makes request to tus server to create a new upload url for the required file upload. - """ - headers = self.headers - headers["upload-length"] = str(self.file_size) - headers["upload-metadata"] = ",".join(self.encode_metadata()) - headers["origin"] = cli.api.host # required by CVAT server - resp = self._session.post(self.client.url, headers=headers) - url = resp.headers.get("location") - if url is None: - msg = "Attempt to retrieve create file url with status {}".format( - resp.status_code - ) - raise uploader.TusCommunicationError(msg, resp.status_code, resp.content) - return uploader.urljoin(self.client.url, url) - - @uploader._catch_requests_error - def get_offset(self): - """ - Return offset from tus server. - - This is different from the instance attribute 'offset' because this makes an - http request to the tus server to retrieve the offset. - """ - resp = self._session.head(self.url, headers=self.headers) - offset = resp.headers.get("upload-offset") - if offset is None: - msg = "Attempt to retrieve offset fails with status {}".format(resp.status_code) - raise uploader.TusCommunicationError(msg, resp.status_code, resp.content) - return int(offset) - - tus_client = client.TusClient(url, headers=cli.session.headers) - return MyTusUploader(client=tus_client, session=cli.session, **kwargs) - - def _upload_file_data_with_tus(self, url, filename, *, params=None, pbar=None, logger=None): - CHUNK_SIZE = 10 * 2**20 - - file_size = os.stat(filename).st_size - - with open(filename, "rb") as input_file: - if pbar is not None: - input_file = StreamWithProgress(input_file, pbar, length=file_size) - - tus_uploader = self._make_tus_uploader( - url + "/", - metadata=params, - file_stream=input_file, - chunk_size=CHUNK_SIZE, - log_func=logger, - ) - tus_uploader.upload() - - def _upload_file_with_tus(self, url, filename, *, params=None, pbar=None, logger=None): - # "CVAT-TUS" protocol has 2 extra messages - self._tus_start_upload(url, params=params) - self._upload_file_data_with_tus( - url=url, filename=filename, params=params, pbar=pbar, logger=logger - ) - return self._tus_finish_upload(url, params=params) - - def _tus_start_upload(self, url, *, params=None): - response = self.session.post(url, headers={"Upload-Start": ""}, params=params) - expect_status(202, response) - return response - - def _tus_finish_upload(self, url, *, params=None, data=None): - response = self.session.post(url, headers={"Upload-Finish": ""}, params=params, data=data) - expect_status(202, response) - return response - - def tasks_upload( - self, task_id, fileformat, filename, *, completion_check_period=2, pbar=None, **kwargs - ): - """Upload annotations for a task in the specified format - (e.g. 'YOLO ZIP 1.0').""" - url = self.api.tasks_id_annotations(task_id) - params = {"format": fileformat, "filename": os.path.basename(filename)} - - if pbar is None: - pbar = self._make_pbar("Uploading...") - - self._upload_file_with_tus(url, filename, params=params, pbar=pbar, logger=log.debug) - - while True: - response = self.session.put(url, params=params) - response.raise_for_status() - if response.status_code == 201: - break - - sleep(completion_check_period) - - log.info(f"Upload job for Task ID {task_id} " f"with annotation file {filename} finished") - - def tasks_export(self, task_id, filename, *, completion_check_period=2, pbar=None, **kwargs): - """Download a task backup""" - log.info("Waiting for the server to prepare the file...") - - url = self.api.tasks_id_backup(task_id) - while True: - response = self.session.get(url) - response.raise_for_status() - log.info("STATUS {}".format(response.status_code)) - if response.status_code == 201: - break - sleep(completion_check_period) - - if pbar is None: - pbar = self._make_pbar("Downloading") - self._download_file(url + "?action=download", output_path=filename, pbar=pbar) - - log.info(f"Task {task_id} has been exported sucessfully " f"to {os.path.abspath(filename)}") - - def tasks_import(self, filename, *, completion_check_period=2, pbar=None, **kwargs) -> None: - """Import a task from a backup file""" - - url = self.api.tasks_backup() - params = {"filename": os.path.basename(filename)} - - if pbar is None: - pbar = self._make_pbar("Uploading...") - - response = self._upload_file_with_tus( - url, filename, params=params, pbar=pbar, logger=log.debug - ) - response_json = response.json() - rq_id = response_json["rq_id"] - - # check task status - while True: - sleep(completion_check_period) - - response = self.session.post(url, data={"rq_id": rq_id}) - if response.status_code == 201: - break - expect_status(202, response) - - task_id = response.json()["id"] - log.info(f"Task has been imported sucessfully. Task ID: {task_id}") - - def login(self, credentials): - url = self.api.login - auth = {"username": credentials[0], "password": credentials[1]} - response = self.session.post(url, auth) - response.raise_for_status() - if "csrftoken" in response.cookies: - self.session.headers["X-CSRFToken"] = response.cookies["csrftoken"] - - def _make_pbar(self, title: str = None) -> tqdm.tqdm: - return tqdm.tqdm(unit_scale=True, unit="B", unit_divisor=1024, desc=title) - - def _download_file( - self, url: str, output_path: str, *, timeout: int = 60, pbar: Optional[tqdm.tqdm] = None - ) -> None: - """ - Downloads the file from url into a temporary file, then renames it - to the requested name. - """ - - CHUNK_SIZE = 10 * 2**20 - - assert not osp.exists(output_path) - - tmp_path = output_path + ".tmp" - if osp.exists(tmp_path): - raise FileExistsError(f"Can't write temporary file '{tmp_path}' - file exists") - - response = self.session.get(url, timeout=timeout, stream=True) - - with closing(response): - response.raise_for_status() - - try: - file_size = int(response.headers.get("Content-Length", 0)) - except (ValueError, KeyError): - file_size = None - - try: - with open(tmp_path, "wb") as fd: - if pbar is not None: - pbar.reset(file_size) - - try: - for chunk in response.iter_content(chunk_size=CHUNK_SIZE): - if pbar is not None: - pbar.update(n=len(chunk)) - - fd.write(chunk) - finally: - if pbar is not None: - pbar.close() - - os.rename(tmp_path, output_path) - except: - os.unlink(tmp_path) - raise - - -class CVAT_API_V2: - """Build parameterized API URLs""" - - def __init__(self, host, https=False): - if host.startswith("https://"): - https = True - if host.startswith("http://") or host.startswith("https://"): - host = host.replace("http://", "") - host = host.replace("https://", "") - scheme = "https" if https else "http" - self.host = "{}://{}".format(scheme, host) - self.base = self.host + "/api/" - self.git = f"{scheme}://{host}/git/repository/" - - @property - def tasks(self): - return self.base + "tasks" - - def tasks_page(self, page_id): - return self.tasks + "?page={}".format(page_id) - - def tasks_backup(self): - return self.tasks + "/backup" - - def tasks_id(self, task_id): - return self.tasks + "/{}".format(task_id) - - def tasks_id_data(self, task_id): - return self.tasks_id(task_id) + "/data" - - def tasks_id_frame_id(self, task_id, frame_id, quality): - return self.tasks_id(task_id) + "/data?type=frame&number={}&quality={}".format( - frame_id, quality - ) - - def tasks_id_status(self, task_id): - return self.tasks_id(task_id) + "/status" - - def tasks_id_backup(self, task_id): - return self.tasks_id(task_id) + "/backup" - - def tasks_id_annotations(self, task_id): - return self.tasks_id(task_id) + "/annotations" - - def tasks_id_annotations_format(self, task_id, fileformat): - return self.tasks_id_annotations(task_id) + "?format={}".format(fileformat) - - def tasks_id_annotations_filename(self, task_id, name, fileformat): - return self.tasks_id_annotations(task_id) + "?format={}&filename={}".format( - fileformat, name - ) - - def git_create(self, task_id): - return self.git + f"create/{task_id}" - - def git_check(self, rq_id): - return self.git + f"check/{rq_id}" - - @property - def login(self): - return self.base + "auth/login" diff --git a/cvat-cli/src/cvat_cli/core/definition.py b/cvat-cli/src/cvat_cli/core/definition.py deleted file mode 100644 index 2456713c..00000000 --- a/cvat-cli/src/cvat_cli/core/definition.py +++ /dev/null @@ -1,292 +0,0 @@ -# Copyright (C) 2021-2022 Intel Corporation -# -# SPDX-License-Identifier: MIT -import argparse -import getpass -import json -import logging -import os -from enum import Enum - -from ..version import VERSION - - -def get_auth(s): - """Parse USER[:PASS] strings and prompt for password if none was - supplied.""" - user, _, password = s.partition(":") - password = password or os.environ.get("PASS") or getpass.getpass() - return user, password - - -def parse_label_arg(s): - """If s is a file load it as JSON, otherwise parse s as JSON.""" - if os.path.exists(s): - fp = open(s, "r") - return json.load(fp) - else: - return json.loads(s) - - -class ResourceType(Enum): - - LOCAL = 0 - SHARE = 1 - REMOTE = 2 - - def __str__(self): - return self.name.lower() - - def __repr__(self): - return str(self) - - @staticmethod - def argparse(s): - try: - return ResourceType[s.upper()] - except KeyError: - return s - - -####################################################################### -# Command line interface definition -####################################################################### - -parser = argparse.ArgumentParser(description="Perform common operations related to CVAT tasks.\n\n") -parser.add_argument("--version", action="version", version=VERSION) - -task_subparser = parser.add_subparsers(dest="action") - -####################################################################### -# Positional arguments -####################################################################### - -parser.add_argument( - "--auth", - type=get_auth, - metavar="USER:[PASS]", - default=getpass.getuser(), - help="""defaults to the current user and supports the PASS - environment variable or password prompt - (default user: %(default)s).""", -) -parser.add_argument( - "--server-host", type=str, default="localhost", help="host (default: %(default)s)" -) -parser.add_argument("--server-port", type=int, default="8080", help="port (default: %(default)s)") -parser.add_argument( - "--https", - default=False, - action="store_true", - help="using https connection (default: %(default)s)", -) -parser.add_argument( - "--debug", - action="store_const", - dest="loglevel", - const=logging.DEBUG, - default=logging.INFO, - help="show debug output", -) - -####################################################################### -# Create -####################################################################### - -task_create_parser = task_subparser.add_parser( - "create", - description="""Create a new CVAT task. To create a task, you need - to specify labels using the --labels argument or - attach the task to an existing project using the - --project_id argument.""", -) -task_create_parser.add_argument("name", type=str, help="name of the task") -task_create_parser.add_argument( - "resource_type", - default="local", - choices=list(ResourceType), - type=ResourceType.argparse, - help="type of files specified", -) -task_create_parser.add_argument("resources", type=str, help="list of paths or URLs", nargs="+") -task_create_parser.add_argument( - "--annotation_path", default="", type=str, help="path to annotation file" -) -task_create_parser.add_argument( - "--annotation_format", - default="CVAT 1.1", - type=str, - help="format of the annotation file being uploaded, e.g. CVAT 1.1", -) -task_create_parser.add_argument( - "--bug_tracker", "--bug", default=None, type=str, help="bug tracker URL" -) -task_create_parser.add_argument( - "--chunk_size", default=None, type=int, help="the number of frames per chunk" -) -task_create_parser.add_argument( - "--completion_verification_period", - default=20, - type=int, - help="""number of seconds to wait until checking - if data compression finished (necessary before uploading annotations)""", -) -task_create_parser.add_argument( - "--copy_data", - default=False, - action="store_true", - help="""set the option to copy the data, only used when resource type is - share (default: %(default)s)""", -) -task_create_parser.add_argument( - "--dataset_repository_url", - default="", - type=str, - help=( - "git repository to store annotations e.g." - " https://github.com/user/repos [annotation/]" - ), -) -task_create_parser.add_argument( - "--frame_step", - default=None, - type=int, - help="""set the frame step option in the advanced configuration - when uploading image series or videos (default: %(default)s)""", -) -task_create_parser.add_argument( - "--image_quality", - default=70, - type=int, - help="""set the image quality option in the advanced configuration - when creating tasks.(default: %(default)s)""", -) -task_create_parser.add_argument( - "--labels", - default="[]", - type=parse_label_arg, - help="string or file containing JSON labels specification", -) -task_create_parser.add_argument( - "--lfs", - default=False, - action="store_true", - help="using lfs for dataset repository (default: %(default)s)", -) -task_create_parser.add_argument( - "--project_id", default=None, type=int, help="project ID if project exists" -) -task_create_parser.add_argument( - "--overlap", - default=None, - type=int, - help="the number of intersected frames between different segments", -) -task_create_parser.add_argument( - "--segment_size", default=None, type=int, help="the number of frames in a segment" -) -task_create_parser.add_argument( - "--sorting-method", - default="lexicographical", - choices=["lexicographical", "natural", "predefined", "random"], - help="""data soring method (default: %(default)s)""", -) -task_create_parser.add_argument( - "--start_frame", default=None, type=int, help="the start frame of the video" -) -task_create_parser.add_argument( - "--stop_frame", default=None, type=int, help="the stop frame of the video" -) -task_create_parser.add_argument( - "--use_cache", action="store_true", help="""use cache""" # automatically sets default=False -) -task_create_parser.add_argument( - "--use_zip_chunks", - action="store_true", # automatically sets default=False - help="""zip chunks before sending them to the server""", -) - -####################################################################### -# Delete -####################################################################### - -delete_parser = task_subparser.add_parser("delete", description="Delete a CVAT task.") -delete_parser.add_argument("task_ids", type=int, help="list of task IDs", nargs="+") - -####################################################################### -# List -####################################################################### - -ls_parser = task_subparser.add_parser( - "ls", description="List all CVAT tasks in simple or JSON format." -) -ls_parser.add_argument( - "--json", dest="use_json_output", default=False, action="store_true", help="output JSON data" -) - -####################################################################### -# Frames -####################################################################### - -frames_parser = task_subparser.add_parser( - "frames", description="Download all frame images for a CVAT task." -) -frames_parser.add_argument("task_id", type=int, help="task ID") -frames_parser.add_argument("frame_ids", type=int, help="list of frame IDs to download", nargs="+") -frames_parser.add_argument( - "--outdir", type=str, default="", help="directory to save images (default: CWD)" -) -frames_parser.add_argument( - "--quality", - type=str, - choices=("original", "compressed"), - default="original", - help="choose quality of images (default: %(default)s)", -) - -####################################################################### -# Dump -####################################################################### - -dump_parser = task_subparser.add_parser("dump", description="Download annotations for a CVAT task.") -dump_parser.add_argument("task_id", type=int, help="task ID") -dump_parser.add_argument("filename", type=str, help="output file") -dump_parser.add_argument( - "--format", - dest="fileformat", - type=str, - default="CVAT for images 1.1", - help="annotation format (default: %(default)s)", -) - -####################################################################### -# Upload Annotations -####################################################################### - -upload_parser = task_subparser.add_parser( - "upload", description="Upload annotations for a CVAT task." -) -upload_parser.add_argument("task_id", type=int, help="task ID") -upload_parser.add_argument("filename", type=str, help="upload file") -upload_parser.add_argument( - "--format", - dest="fileformat", - type=str, - default="CVAT 1.1", - help="annotation format (default: %(default)s)", -) - -####################################################################### -# Export task -####################################################################### - -export_task_parser = task_subparser.add_parser("export", description="Export a CVAT task.") -export_task_parser.add_argument("task_id", type=int, help="task ID") -export_task_parser.add_argument("filename", type=str, help="output file") - -####################################################################### -# Import task -####################################################################### - -import_task_parser = task_subparser.add_parser("import", description="Import a CVAT task.") -import_task_parser.add_argument("filename", type=str, help="upload file") diff --git a/cvat-cli/src/cvat_cli/core/utils.py b/cvat-cli/src/cvat_cli/core/utils.py deleted file mode 100644 index f9b63450..00000000 --- a/cvat-cli/src/cvat_cli/core/utils.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (C) 2022 Intel Corporation -# -# SPDX-License-Identifier: MIT - -from __future__ import annotations - -import io - -import requests -import tqdm - - -class StreamWithProgress: - def __init__(self, stream: io.RawIOBase, pbar: tqdm.tqdm, length=None): - self.stream = stream - self.pbar = pbar - - if hasattr(stream, "__len__"): - length = len(stream) - - self.length = length - pbar.reset(length) - - def read(self, size=-1): - chunk = self.stream.read(size) - if chunk is not None: - self.pbar.update(n=len(chunk)) - return chunk - - def __len__(self): - return self.length - - def seek(self, pos, start=0): - self.stream.seek(pos, start) - self.pbar.n = pos - - def tell(self): - return self.stream.tell() - - -def expect_status(code: int, response: requests.Response) -> None: - response.raise_for_status() - if response.status_code != code: - raise Exception( - "Failed to upload file: " f"unexpected status code received ({response.status_code})" - ) diff --git a/cvat-cli/src/cvat_cli/parser.py b/cvat-cli/src/cvat_cli/parser.py new file mode 100644 index 00000000..a4dc8179 --- /dev/null +++ b/cvat-cli/src/cvat_cli/parser.py @@ -0,0 +1,334 @@ +# Copyright (C) 2021-2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +import argparse +import getpass +import json +import logging +import os +from distutils.util import strtobool + +from cvat_sdk.core.types import ResourceType + +from .version import VERSION + + +def get_auth(s): + """Parse USER[:PASS] strings and prompt for password if none was + supplied.""" + user, _, password = s.partition(":") + password = password or os.environ.get("PASS") or getpass.getpass() + return user, password + + +def parse_label_arg(s): + """If s is a file load it as JSON, otherwise parse s as JSON.""" + if os.path.exists(s): + with open(s, "r") as fp: + return json.load(fp) + else: + return json.loads(s) + + +def parse_resource_type(s: str) -> ResourceType: + try: + return ResourceType[s.upper()] + except KeyError: + return s + + +def make_cmdline_parser() -> argparse.ArgumentParser: + ####################################################################### + # Command line interface definition + ####################################################################### + parser = argparse.ArgumentParser( + description="Perform common operations related to CVAT tasks.\n\n" + ) + parser.add_argument("--version", action="version", version=VERSION) + + task_subparser = parser.add_subparsers(dest="action") + + ####################################################################### + # Positional arguments + ####################################################################### + parser.add_argument( + "--auth", + type=get_auth, + metavar="USER:[PASS]", + default=getpass.getuser(), + help="""defaults to the current user and supports the PASS + environment variable or password prompt + (default user: %(default)s).""", + ) + parser.add_argument( + "--server-host", type=str, default="localhost", help="host (default: %(default)s)" + ) + parser.add_argument( + "--server-port", type=int, default="8080", help="port (default: %(default)s)" + ) + parser.add_argument( + "--https", + default=False, + action="store_true", + help="using https connection (default: %(default)s)", + ) + parser.add_argument( + "--debug", + action="store_const", + dest="loglevel", + const=logging.DEBUG, + default=logging.INFO, + help="show debug output", + ) + + ####################################################################### + # Create + ####################################################################### + task_create_parser = task_subparser.add_parser( + "create", + description="""Create a new CVAT task. To create a task, you need + to specify labels using the --labels argument or + attach the task to an existing project using the + --project_id argument.""", + ) + task_create_parser.add_argument("name", type=str, help="name of the task") + task_create_parser.add_argument( + "resource_type", + default="local", + choices=list(ResourceType), + type=parse_resource_type, + help="type of files specified", + ) + task_create_parser.add_argument("resources", type=str, help="list of paths or URLs", nargs="+") + task_create_parser.add_argument( + "--annotation_path", default="", type=str, help="path to annotation file" + ) + task_create_parser.add_argument( + "--annotation_format", + default="CVAT 1.1", + type=str, + help="format of the annotation file being uploaded, e.g. CVAT 1.1", + ) + task_create_parser.add_argument( + "--bug_tracker", "--bug", default=None, type=str, help="bug tracker URL" + ) + task_create_parser.add_argument( + "--chunk_size", default=None, type=int, help="the number of frames per chunk" + ) + task_create_parser.add_argument( + "--completion_verification_period", + dest="status_check_period", + default=20, + type=float, + help="""number of seconds to wait until checking + if data compression finished (necessary before uploading annotations)""", + ) + task_create_parser.add_argument( + "--copy_data", + default=False, + action="store_true", + help="""set the option to copy the data, only used when resource type is + share (default: %(default)s)""", + ) + task_create_parser.add_argument( + "--dataset_repository_url", + default="", + type=str, + help=( + "git repository to store annotations e.g." + " https://github.com/user/repos [annotation/]" + ), + ) + task_create_parser.add_argument( + "--frame_step", + default=None, + type=int, + help="""set the frame step option in the advanced configuration + when uploading image series or videos (default: %(default)s)""", + ) + task_create_parser.add_argument( + "--image_quality", + default=70, + type=int, + help="""set the image quality option in the advanced configuration + when creating tasks.(default: %(default)s)""", + ) + task_create_parser.add_argument( + "--labels", + default="[]", + type=parse_label_arg, + help="string or file containing JSON labels specification", + ) + task_create_parser.add_argument( + "--lfs", + default=False, + action="store_true", + help="using lfs for dataset repository (default: %(default)s)", + ) + task_create_parser.add_argument( + "--project_id", default=None, type=int, help="project ID if project exists" + ) + task_create_parser.add_argument( + "--overlap", + default=None, + type=int, + help="the number of intersected frames between different segments", + ) + task_create_parser.add_argument( + "--segment_size", default=None, type=int, help="the number of frames in a segment" + ) + task_create_parser.add_argument( + "--sorting-method", + default="lexicographical", + choices=["lexicographical", "natural", "predefined", "random"], + help="""data soring method (default: %(default)s)""", + ) + task_create_parser.add_argument( + "--start_frame", default=None, type=int, help="the start frame of the video" + ) + task_create_parser.add_argument( + "--stop_frame", default=None, type=int, help="the stop frame of the video" + ) + task_create_parser.add_argument( + "--use_cache", action="store_true", help="""use cache""" # automatically sets default=False + ) + task_create_parser.add_argument( + "--use_zip_chunks", + action="store_true", # automatically sets default=False + help="""zip chunks before sending them to the server""", + ) + + ####################################################################### + # Delete + ####################################################################### + delete_parser = task_subparser.add_parser("delete", description="Delete a CVAT task.") + delete_parser.add_argument("task_ids", type=int, help="list of task IDs", nargs="+") + + ####################################################################### + # List + ####################################################################### + ls_parser = task_subparser.add_parser( + "ls", description="List all CVAT tasks in simple or JSON format." + ) + ls_parser.add_argument( + "--json", + dest="use_json_output", + default=False, + action="store_true", + help="output JSON data", + ) + + ####################################################################### + # Frames + ####################################################################### + frames_parser = task_subparser.add_parser( + "frames", description="Download all frame images for a CVAT task." + ) + frames_parser.add_argument("task_id", type=int, help="task ID") + frames_parser.add_argument( + "frame_ids", type=int, help="list of frame IDs to download", nargs="+" + ) + frames_parser.add_argument( + "--outdir", type=str, default="", help="directory to save images (default: CWD)" + ) + frames_parser.add_argument( + "--quality", + type=str, + choices=("original", "compressed"), + default="original", + help="choose quality of images (default: %(default)s)", + ) + + ####################################################################### + # Dump + ####################################################################### + dump_parser = task_subparser.add_parser( + "dump", description="Download annotations for a CVAT task." + ) + dump_parser.add_argument("task_id", type=int, help="task ID") + dump_parser.add_argument("filename", type=str, help="output file") + dump_parser.add_argument( + "--format", + dest="fileformat", + type=str, + default="CVAT for images 1.1", + help="annotation format (default: %(default)s)", + ) + dump_parser.add_argument( + "--completion_verification_period", + dest="status_check_period", + default=3, + type=float, + help="number of seconds to wait until checking if dataset building finished", + ) + dump_parser.add_argument( + "--with-images", + type=strtobool, + default=False, + dest="include_images", + help="Whether to include images or not (default: %(default)s)", + ) + + ####################################################################### + # Upload Annotations + ####################################################################### + upload_parser = task_subparser.add_parser( + "upload", description="Upload annotations for a CVAT task." + ) + upload_parser.add_argument("task_id", type=int, help="task ID") + upload_parser.add_argument("filename", type=str, help="upload file") + upload_parser.add_argument( + "--format", + dest="fileformat", + type=str, + default="CVAT 1.1", + help="annotation format (default: %(default)s)", + ) + + ####################################################################### + # Export task + ####################################################################### + export_task_parser = task_subparser.add_parser("export", description="Export a CVAT task.") + export_task_parser.add_argument("task_id", type=int, help="task ID") + export_task_parser.add_argument("filename", type=str, help="output file") + export_task_parser.add_argument( + "--completion_verification_period", + dest="status_check_period", + default=3, + type=float, + help="time interval between checks if archive building has been finished, in seconds", + ) + + ####################################################################### + # Import task + ####################################################################### + import_task_parser = task_subparser.add_parser("import", description="Import a CVAT task.") + import_task_parser.add_argument("filename", type=str, help="upload file") + import_task_parser.add_argument( + "--completion_verification_period", + dest="status_check_period", + default=3, + type=float, + help="time interval between checks if archive proessing was finished, in seconds", + ) + + return parser + + +def get_action_args( + parser: argparse.ArgumentParser, parsed_args: argparse.Namespace +) -> argparse.Namespace: + # FIXME: a hacky way to remove unnecessary args + action_args = dict(vars(parsed_args)) + + for action in parser._actions: + action_args.pop(action.dest, None) + + # remove default args + for k, v in dict(action_args).items(): + if v is None: + action_args.pop(k, None) + + return argparse.Namespace(**action_args) diff --git a/cvat-cli/src/cvat_cli/version.py b/cvat-cli/src/cvat_cli/version.py index 72bdd01c..bb283134 100644 --- a/cvat-cli/src/cvat_cli/version.py +++ b/cvat-cli/src/cvat_cli/version.py @@ -1 +1 @@ -VERSION = "0.1" +VERSION = "0.2-alpha" diff --git a/cvat-cli/tests/__init__.py b/cvat-cli/tests/__init__.py deleted file mode 100644 index eed40849..00000000 --- a/cvat-cli/tests/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright (C) 2020-2022 Intel Corporation -# -# SPDX-License-Identifier: MIT diff --git a/cvat-cli/tests/test_cli.py b/cvat-cli/tests/test_cli.py deleted file mode 100644 index ce27d14c..00000000 --- a/cvat-cli/tests/test_cli.py +++ /dev/null @@ -1,280 +0,0 @@ -# Copyright (C) 2020-2022 Intel Corporation -# -# SPDX-License-Identifier: MIT - -import io -import logging -import os -import unittest.mock as mock -from contextlib import closing, redirect_stdout - -import cvat.apps.engine.log as log -from cvat.apps.engine.tests.test_rest_api import create_db_users, generate_image_file -from datumaro.util.scope import on_exit_do, scoped -from django.conf import settings -from PIL import Image -from rest_framework.test import APITestCase, RequestsClient -from tqdm import tqdm - -from cvat_cli.core import CLI, CVAT_API_V2, ResourceType - - -class TestCLI(APITestCase): - def setUp(self): - self._stdout_handler = redirect_stdout(io.StringIO()) - mock_stdout = self._stdout_handler.__enter__() - log = logging.getLogger("cvat_cli") - log.propagate = False - log.setLevel(logging.INFO) - log.handlers.clear() - log.addHandler(logging.StreamHandler(mock_stdout)) - self.mock_stdout = mock_stdout - - self.client = RequestsClient() - self.credentials = ("admin", "admin") - self.api = CVAT_API_V2("testserver") - self.cli = CLI(self.client, self.api, self.credentials) - - @classmethod - def setUpClass(cls): - super().setUpClass() - cls.img_file = os.path.join(settings.SHARE_ROOT, "test_cli.jpg") - _, data = generate_image_file(cls.img_file) - with open(cls.img_file, "wb") as image: - image.write(data.read()) - - @classmethod - def tearDownClass(cls): - super().tearDownClass() - os.remove(cls.img_file) - - def tearDown(self): - super().tearDown() - self._stdout_handler.__exit__(None, None, None) - log.close_all() # Release logging resources correctly - - @classmethod - def setUpTestData(cls): - create_db_users(cls) - - def test_tasks_create(self): - with closing(io.StringIO()) as pbar_out: - pbar = tqdm(file=pbar_out, mininterval=0) - - task_id = self.cli.tasks_create( - "test_task", - [{"name": "car"}, {"name": "person"}], - ResourceType.LOCAL, - [self.img_file], - pbar=pbar, - ) - - pbar_out = pbar_out.getvalue().strip("\r").split("\r") - - self.assertEqual(1, task_id) - self.assertRegex(pbar_out[-1], "100%") - - -class TestTaskOperations(APITestCase): - def setUp(self): - self._stdout_handler = redirect_stdout(io.StringIO()) - mock_stdout = self._stdout_handler.__enter__() - log = logging.getLogger("cvat_cli") - log.propagate = False - log.setLevel(logging.INFO) - log.handlers.clear() - log.addHandler(logging.StreamHandler(mock_stdout)) - self.mock_stdout = mock_stdout - - self.client = RequestsClient() - self.credentials = ("admin", "admin") - self.api = CVAT_API_V2("testserver") - self.cli = CLI(self.client, self.api, self.credentials) - self.taskname = "test_task" - self.task_id = self.cli.tasks_create( - self.taskname, - [{"name": "car"}, {"name": "person"}], - ResourceType.LOCAL, - [self.img_file], - pbar=mock.MagicMock(), - ) - - def tearDown(self): - super().tearDown() - self._stdout_handler.__exit__(None, None, None) - log.close_all() # Release logging resources correctly - - @classmethod - def setUpClass(cls): - super().setUpClass() - cls.img_file = os.path.join(settings.SHARE_ROOT, "test_cli.jpg") - _, data = generate_image_file(cls.img_file) - with open(cls.img_file, "wb") as image: - image.write(data.read()) - - @classmethod - def tearDownClass(cls): - super().tearDownClass() - os.remove(cls.img_file) - - @classmethod - def setUpTestData(cls): - create_db_users(cls) - - def test_tasks_list(self): - self.cli.tasks_list(False) - self.assertRegex(self.mock_stdout.getvalue(), ".*{}.*".format(self.taskname)) - - def test_tasks_delete(self): - self.cli.tasks_delete([1]) - self.cli.tasks_list(False) - self.assertRegex(self.mock_stdout.getvalue(), ".*Task ID {} deleted.*".format(1)) - - @scoped - def test_tasks_dump(self): - path = os.path.join(settings.SHARE_ROOT, "test_cli.zip") - - with closing(io.StringIO()) as pbar_out: - pbar = tqdm(file=pbar_out, mininterval=0) - - self.cli.tasks_dump(self.task_id, "CVAT for images 1.1", path, pbar=pbar) - on_exit_do(os.remove, path) - - pbar_out = pbar_out.getvalue().strip("\r").split("\r") - - self.assertTrue(os.path.exists(path)) - self.assertRegex(pbar_out[-1], "100%") - - @scoped - def test_tasks_export(self): - path = os.path.join(settings.SHARE_ROOT, "test_cli.zip") - - with closing(io.StringIO()) as pbar_out: - pbar = tqdm(file=pbar_out, mininterval=0) - - self.cli.tasks_export(self.task_id, path, pbar=pbar) - on_exit_do(os.remove, path) - - pbar_out = pbar_out.getvalue().strip("\r").split("\r") - - self.assertTrue(os.path.exists(path)) - self.assertRegex(pbar_out[-1], "100%") - - @scoped - def test_tasks_frame_original(self): - path = os.path.join(settings.SHARE_ROOT, "task_1_frame_000000.jpg") - - self.cli.tasks_frame(self.task_id, [0], outdir=settings.SHARE_ROOT, quality="original") - on_exit_do(os.remove, path) - - self.assertTrue(os.path.exists(path)) - - @scoped - def test_tasks_frame(self): - path = os.path.join(settings.SHARE_ROOT, "task_1_frame_000000.jpg") - - self.cli.tasks_frame(self.task_id, [0], outdir=settings.SHARE_ROOT, quality="compressed") - on_exit_do(os.remove, path) - - self.assertTrue(os.path.exists(path)) - - @scoped - def test_tasks_upload(self): - path = os.path.join(settings.SHARE_ROOT, "test_cli.json") - self._generate_coco_file(path) - on_exit_do(os.remove, path) - - with closing(io.StringIO()) as pbar_out: - pbar = tqdm(file=pbar_out, mininterval=0) - - self.cli.tasks_upload(self.task_id, "COCO 1.0", path, pbar=pbar) - - pbar_out = pbar_out.getvalue().strip("\r").split("\r") - - self.assertRegex(self.mock_stdout.getvalue(), ".*{}.*".format("annotation file")) - self.assertRegex(pbar_out[-1], "100%") - - @scoped - def test_tasks_import(self): - anno_path = os.path.join(settings.SHARE_ROOT, "test_cli.json") - self._generate_coco_file(anno_path) - on_exit_do(os.remove, anno_path) - - backup_path = os.path.join(settings.SHARE_ROOT, "task_backup.zip") - with closing(io.StringIO()) as pbar_out: - pbar = tqdm(file=pbar_out, mininterval=0) - self.cli.tasks_upload(self.task_id, "COCO 1.0", anno_path, pbar=pbar) - self.cli.tasks_export(self.task_id, backup_path, pbar=pbar) - on_exit_do(os.remove, backup_path) - - with closing(io.StringIO()) as pbar_out: - pbar = tqdm(file=pbar_out, mininterval=0) - - self.cli.tasks_import(backup_path, pbar=pbar) - - pbar_out = pbar_out.getvalue().strip("\r").split("\r") - - self.assertRegex(self.mock_stdout.getvalue(), ".*{}.*".format("exported sucessfully")) - self.assertRegex(pbar_out[-1], "100%") - - def _generate_coco_file(self, path): - test_image = Image.open(self.img_file) - image_width, image_height = test_image.size - - content = self._generate_coco_anno( - os.path.basename(self.img_file), image_width=image_width, image_height=image_height - ) - with open(path, "w") as coco: - coco.write(content) - - @staticmethod - def _generate_coco_anno(image_path, image_width, image_height): - return """{ - "categories": [ - { - "id": 1, - "name": "car", - "supercategory": "" - }, - { - "id": 2, - "name": "person", - "supercategory": "" - } - ], - "images": [ - { - "coco_url": "", - "date_captured": "", - "flickr_url": "", - "license": 0, - "id": 0, - "file_name": "%(image_path)s", - "height": %(image_height)d, - "width": %(image_width)d - } - ], - "annotations": [ - { - "category_id": 1, - "id": 1, - "image_id": 0, - "iscrowd": 0, - "segmentation": [ - [] - ], - "area": 17702.0, - "bbox": [ - 574.0, - 407.0, - 167.0, - 106.0 - ] - } - ] - } - """ % { - "image_path": image_path, - "image_height": image_height, - "image_width": image_width, - } diff --git a/cvat-sdk/.gitignore b/cvat-sdk/.gitignore index 43995bd4..7552f3ba 100644 --- a/cvat-sdk/.gitignore +++ b/cvat-sdk/.gitignore @@ -64,3 +64,14 @@ target/ #Ipython Notebook .ipynb_checkpoints + +# Workflow +schema/ +.openapi-generator/ + +# Generated code +cvat_sdk/api_client/ +requirements/ +docs/ +setup.py +README.md \ No newline at end of file diff --git a/cvat-sdk/.openapi-generator-ignore b/cvat-sdk/.openapi-generator-ignore index 907f89d7..44b0733a 100644 --- a/cvat-sdk/.openapi-generator-ignore +++ b/cvat-sdk/.openapi-generator-ignore @@ -23,14 +23,18 @@ #!docs/README.md # For safety +/cvat_sdk/__init__.py /config /gen +/helpers.py +/utils.py +/types.py # Don't generate these files /git_push.sh -/requirements.txt /setup.cfg /test-requirements.txt /tox.ini /.gitlab-ci.yml -/.travis.yml \ No newline at end of file +/.travis.yml +/.gitignore diff --git a/cvat-sdk/.openapi-generator/FILES b/cvat-sdk/.openapi-generator/FILES deleted file mode 100644 index 7b11e774..00000000 --- a/cvat-sdk/.openapi-generator/FILES +++ /dev/null @@ -1,281 +0,0 @@ -.gitignore -README.md -cvat_sdk/__init__.py -cvat_sdk/api/__init__.py -cvat_sdk/api/auth_api.py -cvat_sdk/api/cloud_storages_api.py -cvat_sdk/api/comments_api.py -cvat_sdk/api/invitations_api.py -cvat_sdk/api/issues_api.py -cvat_sdk/api/jobs_api.py -cvat_sdk/api/lambda_api.py -cvat_sdk/api/memberships_api.py -cvat_sdk/api/organizations_api.py -cvat_sdk/api/projects_api.py -cvat_sdk/api/restrictions_api.py -cvat_sdk/api/schema_api.py -cvat_sdk/api/server_api.py -cvat_sdk/api/tasks_api.py -cvat_sdk/api/users_api.py -cvat_sdk/api_client.py -cvat_sdk/apis/__init__.py -cvat_sdk/configuration.py -cvat_sdk/exceptions.py -cvat_sdk/model/__init__.py -cvat_sdk/model/about.py -cvat_sdk/model/annotation_file_request.py -cvat_sdk/model/attribute.py -cvat_sdk/model/attribute_request.py -cvat_sdk/model/attribute_val.py -cvat_sdk/model/basic_user.py -cvat_sdk/model/basic_user_request.py -cvat_sdk/model/chunk_type.py -cvat_sdk/model/cloud_storage_read.py -cvat_sdk/model/cloud_storage_write.py -cvat_sdk/model/cloud_storage_write_request.py -cvat_sdk/model/comment_read.py -cvat_sdk/model/comment_read_owner.py -cvat_sdk/model/comment_write.py -cvat_sdk/model/comment_write_request.py -cvat_sdk/model/credentials_type_enum.py -cvat_sdk/model/data_meta_read.py -cvat_sdk/model/data_request.py -cvat_sdk/model/dataset_file_request.py -cvat_sdk/model/dataset_format.py -cvat_sdk/model/dataset_formats.py -cvat_sdk/model/exception.py -cvat_sdk/model/exception_request.py -cvat_sdk/model/file_info.py -cvat_sdk/model/file_info_type_enum.py -cvat_sdk/model/frame_meta.py -cvat_sdk/model/input_type_enum.py -cvat_sdk/model/invitation_read.py -cvat_sdk/model/invitation_write.py -cvat_sdk/model/invitation_write_request.py -cvat_sdk/model/issue_read.py -cvat_sdk/model/issue_write.py -cvat_sdk/model/issue_write_request.py -cvat_sdk/model/job_commit.py -cvat_sdk/model/job_read.py -cvat_sdk/model/job_stage.py -cvat_sdk/model/job_status.py -cvat_sdk/model/job_write.py -cvat_sdk/model/job_write_request.py -cvat_sdk/model/label.py -cvat_sdk/model/labeled_data.py -cvat_sdk/model/labeled_image.py -cvat_sdk/model/labeled_shape.py -cvat_sdk/model/labeled_track.py -cvat_sdk/model/location_enum.py -cvat_sdk/model/log_event.py -cvat_sdk/model/log_event_request.py -cvat_sdk/model/login_request.py -cvat_sdk/model/manifest.py -cvat_sdk/model/manifest_request.py -cvat_sdk/model/membership_read.py -cvat_sdk/model/membership_write.py -cvat_sdk/model/meta_user.py -cvat_sdk/model/operation_status.py -cvat_sdk/model/organization_read.py -cvat_sdk/model/organization_write.py -cvat_sdk/model/organization_write_request.py -cvat_sdk/model/paginated_cloud_storage_read_list.py -cvat_sdk/model/paginated_comment_read_list.py -cvat_sdk/model/paginated_invitation_read_list.py -cvat_sdk/model/paginated_issue_read_list.py -cvat_sdk/model/paginated_job_commit_list.py -cvat_sdk/model/paginated_job_read_list.py -cvat_sdk/model/paginated_membership_read_list.py -cvat_sdk/model/paginated_meta_user_list.py -cvat_sdk/model/paginated_polymorphic_project_list.py -cvat_sdk/model/paginated_task_read_list.py -cvat_sdk/model/password_change_request.py -cvat_sdk/model/password_reset_confirm_request.py -cvat_sdk/model/password_reset_serializer_ex_request.py -cvat_sdk/model/patched_cloud_storage_write_request.py -cvat_sdk/model/patched_comment_write_request.py -cvat_sdk/model/patched_invitation_write_request.py -cvat_sdk/model/patched_issue_write_request.py -cvat_sdk/model/patched_job_write_request.py -cvat_sdk/model/patched_label_request.py -cvat_sdk/model/patched_membership_write_request.py -cvat_sdk/model/patched_organization_write_request.py -cvat_sdk/model/patched_project_write_request.py -cvat_sdk/model/patched_project_write_request_target_storage.py -cvat_sdk/model/patched_task_write_request.py -cvat_sdk/model/patched_task_write_request_target_storage.py -cvat_sdk/model/patched_user_request.py -cvat_sdk/model/plugins.py -cvat_sdk/model/polymorphic_project.py -cvat_sdk/model/project_file_request.py -cvat_sdk/model/project_read.py -cvat_sdk/model/project_read_assignee.py -cvat_sdk/model/project_read_owner.py -cvat_sdk/model/project_read_target_storage.py -cvat_sdk/model/project_search.py -cvat_sdk/model/project_write.py -cvat_sdk/model/project_write_request.py -cvat_sdk/model/provider_type_enum.py -cvat_sdk/model/rest_auth_detail.py -cvat_sdk/model/restricted_register.py -cvat_sdk/model/restricted_register_request.py -cvat_sdk/model/role_enum.py -cvat_sdk/model/rq_status.py -cvat_sdk/model/rq_status_state_enum.py -cvat_sdk/model/segment.py -cvat_sdk/model/shape_type.py -cvat_sdk/model/signing_request.py -cvat_sdk/model/simple_job.py -cvat_sdk/model/sorting_method.py -cvat_sdk/model/storage.py -cvat_sdk/model/storage_method.py -cvat_sdk/model/storage_request.py -cvat_sdk/model/storage_type.py -cvat_sdk/model/task_file_request.py -cvat_sdk/model/task_read.py -cvat_sdk/model/task_read_target_storage.py -cvat_sdk/model/task_write.py -cvat_sdk/model/task_write_request.py -cvat_sdk/model/token.py -cvat_sdk/model/tracked_shape.py -cvat_sdk/model/user.py -cvat_sdk/model/user_agreement.py -cvat_sdk/model/user_agreement_request.py -cvat_sdk/model_utils.py -cvat_sdk/models/__init__.py -cvat_sdk/rest.py -docs/About.md -docs/AnnotationFileRequest.md -docs/Attribute.md -docs/AttributeRequest.md -docs/AttributeVal.md -docs/AuthApi.md -docs/BasicUser.md -docs/BasicUserRequest.md -docs/ChunkType.md -docs/CloudStorageRead.md -docs/CloudStorageWrite.md -docs/CloudStorageWriteRequest.md -docs/CloudStoragesApi.md -docs/CommentRead.md -docs/CommentReadOwner.md -docs/CommentWrite.md -docs/CommentWriteRequest.md -docs/CommentsApi.md -docs/CredentialsTypeEnum.md -docs/DataMetaRead.md -docs/DataRequest.md -docs/DatasetFileRequest.md -docs/DatasetFormat.md -docs/DatasetFormats.md -docs/Exception.md -docs/ExceptionRequest.md -docs/FileInfo.md -docs/FileInfoTypeEnum.md -docs/FrameMeta.md -docs/InputTypeEnum.md -docs/InvitationRead.md -docs/InvitationWrite.md -docs/InvitationWriteRequest.md -docs/InvitationsApi.md -docs/IssueRead.md -docs/IssueWrite.md -docs/IssueWriteRequest.md -docs/IssuesApi.md -docs/JobCommit.md -docs/JobRead.md -docs/JobStage.md -docs/JobStatus.md -docs/JobWrite.md -docs/JobWriteRequest.md -docs/JobsApi.md -docs/Label.md -docs/LabeledData.md -docs/LabeledImage.md -docs/LabeledShape.md -docs/LabeledTrack.md -docs/LambdaApi.md -docs/LocationEnum.md -docs/LogEvent.md -docs/LogEventRequest.md -docs/LoginRequest.md -docs/Manifest.md -docs/ManifestRequest.md -docs/MembershipRead.md -docs/MembershipWrite.md -docs/MembershipsApi.md -docs/MetaUser.md -docs/OperationStatus.md -docs/OrganizationRead.md -docs/OrganizationWrite.md -docs/OrganizationWriteRequest.md -docs/OrganizationsApi.md -docs/PaginatedCloudStorageReadList.md -docs/PaginatedCommentReadList.md -docs/PaginatedInvitationReadList.md -docs/PaginatedIssueReadList.md -docs/PaginatedJobCommitList.md -docs/PaginatedJobReadList.md -docs/PaginatedMembershipReadList.md -docs/PaginatedMetaUserList.md -docs/PaginatedPolymorphicProjectList.md -docs/PaginatedTaskReadList.md -docs/PasswordChangeRequest.md -docs/PasswordResetConfirmRequest.md -docs/PasswordResetSerializerExRequest.md -docs/PatchedCloudStorageWriteRequest.md -docs/PatchedCommentWriteRequest.md -docs/PatchedInvitationWriteRequest.md -docs/PatchedIssueWriteRequest.md -docs/PatchedJobWriteRequest.md -docs/PatchedLabelRequest.md -docs/PatchedMembershipWriteRequest.md -docs/PatchedOrganizationWriteRequest.md -docs/PatchedProjectWriteRequest.md -docs/PatchedProjectWriteRequestTargetStorage.md -docs/PatchedTaskWriteRequest.md -docs/PatchedTaskWriteRequestTargetStorage.md -docs/PatchedUserRequest.md -docs/Plugins.md -docs/PolymorphicProject.md -docs/ProjectFileRequest.md -docs/ProjectRead.md -docs/ProjectReadAssignee.md -docs/ProjectReadOwner.md -docs/ProjectReadTargetStorage.md -docs/ProjectSearch.md -docs/ProjectWrite.md -docs/ProjectWriteRequest.md -docs/ProjectsApi.md -docs/ProviderTypeEnum.md -docs/RestAuthDetail.md -docs/RestrictedRegister.md -docs/RestrictedRegisterRequest.md -docs/RestrictionsApi.md -docs/RoleEnum.md -docs/RqStatus.md -docs/RqStatusStateEnum.md -docs/SchemaApi.md -docs/Segment.md -docs/ServerApi.md -docs/ShapeType.md -docs/SigningRequest.md -docs/SimpleJob.md -docs/SortingMethod.md -docs/Storage.md -docs/StorageMethod.md -docs/StorageRequest.md -docs/StorageType.md -docs/TaskFileRequest.md -docs/TaskRead.md -docs/TaskReadTargetStorage.md -docs/TaskWrite.md -docs/TaskWriteRequest.md -docs/TasksApi.md -docs/Token.md -docs/TrackedShape.md -docs/User.md -docs/UserAgreement.md -docs/UserAgreementRequest.md -docs/UsersApi.md -setup.py diff --git a/cvat-sdk/.openapi-generator/VERSION b/cvat-sdk/.openapi-generator/VERSION deleted file mode 100644 index 66672d4e..00000000 --- a/cvat-sdk/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.1.0-SNAPSHOT \ No newline at end of file diff --git a/cvat-sdk/README.md b/cvat-sdk/README.md deleted file mode 100644 index 5056293d..00000000 --- a/cvat-sdk/README.md +++ /dev/null @@ -1,415 +0,0 @@ -# cvat-sdk -REST API for Computer Vision Annotation Tool (CVAT) - -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: alpha (2.0) -- Package version: 2.0-alpha -- Build package: org.openapitools.codegen.languages.PythonClientCodegen -For more information, please visit [https://github.com/cvat-ai/cvat](https://github.com/cvat-ai/cvat) - -## Requirements. - -Python >=3.6 - -## Installation & Usage -### pip install - -If the python package is hosted on a repository, you can install directly using: - -```sh -pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git -``` -(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) - -Then import the package: -```python -import cvat_sdk -``` - -### Setuptools - -Install via [Setuptools](http://pypi.python.org/pypi/setuptools). - -```sh -python setup.py install --user -``` -(or `sudo python setup.py install` to install the package for all users) - -Then import the package: -```python -import cvat_sdk -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```python - -import time -import cvat_sdk -from pprint import pprint -from cvat_sdk.api import auth_api -from cvat_sdk.model.login_request import LoginRequest -from cvat_sdk.model.password_change_request import PasswordChangeRequest -from cvat_sdk.model.password_reset_confirm_request import PasswordResetConfirmRequest -from cvat_sdk.model.password_reset_serializer_ex_request import PasswordResetSerializerExRequest -from cvat_sdk.model.rest_auth_detail import RestAuthDetail -from cvat_sdk.model.restricted_register import RestrictedRegister -from cvat_sdk.model.restricted_register_request import RestrictedRegisterRequest -from cvat_sdk.model.signing_request import SigningRequest -from cvat_sdk.model.token import Token -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = auth_api.AuthApi(api_client) - login_request = LoginRequest( - username="username_example", - email="email_example", - password="password_example", - ) # LoginRequest | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - try: - api_response = api_instance.auth_create_login(login_request, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling AuthApi->auth_create_login: %s\n" % e) -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AuthApi* | [**auth_create_login**](docs/AuthApi.md#auth_create_login) | **POST** /api/auth/login | -*AuthApi* | [**auth_create_logout**](docs/AuthApi.md#auth_create_logout) | **POST** /api/auth/logout | -*AuthApi* | [**auth_create_password_change**](docs/AuthApi.md#auth_create_password_change) | **POST** /api/auth/password/change | -*AuthApi* | [**auth_create_password_reset**](docs/AuthApi.md#auth_create_password_reset) | **POST** /api/auth/password/reset | -*AuthApi* | [**auth_create_password_reset_confirm**](docs/AuthApi.md#auth_create_password_reset_confirm) | **POST** /api/auth/password/reset/confirm | -*AuthApi* | [**auth_create_register**](docs/AuthApi.md#auth_create_register) | **POST** /api/auth/register | -*AuthApi* | [**auth_create_signing**](docs/AuthApi.md#auth_create_signing) | **POST** /api/auth/signing | This method signs URL for access to the server -*CloudStoragesApi* | [**cloudstorages_create**](docs/CloudStoragesApi.md#cloudstorages_create) | **POST** /api/cloudstorages | Method creates a cloud storage with a specified characteristics -*CloudStoragesApi* | [**cloudstorages_destroy**](docs/CloudStoragesApi.md#cloudstorages_destroy) | **DELETE** /api/cloudstorages/{id} | Method deletes a specific cloud storage -*CloudStoragesApi* | [**cloudstorages_list**](docs/CloudStoragesApi.md#cloudstorages_list) | **GET** /api/cloudstorages | Returns a paginated list of storages according to query parameters -*CloudStoragesApi* | [**cloudstorages_partial_update**](docs/CloudStoragesApi.md#cloudstorages_partial_update) | **PATCH** /api/cloudstorages/{id} | Methods does a partial update of chosen fields in a cloud storage instance -*CloudStoragesApi* | [**cloudstorages_retrieve**](docs/CloudStoragesApi.md#cloudstorages_retrieve) | **GET** /api/cloudstorages/{id} | Method returns details of a specific cloud storage -*CloudStoragesApi* | [**cloudstorages_retrieve_actions**](docs/CloudStoragesApi.md#cloudstorages_retrieve_actions) | **GET** /api/cloudstorages/{id}/actions | Method returns allowed actions for the cloud storage -*CloudStoragesApi* | [**cloudstorages_retrieve_content**](docs/CloudStoragesApi.md#cloudstorages_retrieve_content) | **GET** /api/cloudstorages/{id}/content | Method returns a manifest content -*CloudStoragesApi* | [**cloudstorages_retrieve_preview**](docs/CloudStoragesApi.md#cloudstorages_retrieve_preview) | **GET** /api/cloudstorages/{id}/preview | Method returns a preview image from a cloud storage -*CloudStoragesApi* | [**cloudstorages_retrieve_status**](docs/CloudStoragesApi.md#cloudstorages_retrieve_status) | **GET** /api/cloudstorages/{id}/status | Method returns a cloud storage status -*CommentsApi* | [**comments_create**](docs/CommentsApi.md#comments_create) | **POST** /api/comments | Method creates a comment -*CommentsApi* | [**comments_destroy**](docs/CommentsApi.md#comments_destroy) | **DELETE** /api/comments/{id} | Method deletes a comment -*CommentsApi* | [**comments_list**](docs/CommentsApi.md#comments_list) | **GET** /api/comments | Method returns a paginated list of comments according to query parameters -*CommentsApi* | [**comments_partial_update**](docs/CommentsApi.md#comments_partial_update) | **PATCH** /api/comments/{id} | Methods does a partial update of chosen fields in a comment -*CommentsApi* | [**comments_retrieve**](docs/CommentsApi.md#comments_retrieve) | **GET** /api/comments/{id} | Method returns details of a comment -*InvitationsApi* | [**invitations_create**](docs/InvitationsApi.md#invitations_create) | **POST** /api/invitations | Method creates an invitation -*InvitationsApi* | [**invitations_destroy**](docs/InvitationsApi.md#invitations_destroy) | **DELETE** /api/invitations/{key} | Method deletes an invitation -*InvitationsApi* | [**invitations_list**](docs/InvitationsApi.md#invitations_list) | **GET** /api/invitations | Method returns a paginated list of invitations according to query parameters -*InvitationsApi* | [**invitations_partial_update**](docs/InvitationsApi.md#invitations_partial_update) | **PATCH** /api/invitations/{key} | Methods does a partial update of chosen fields in an invitation -*InvitationsApi* | [**invitations_retrieve**](docs/InvitationsApi.md#invitations_retrieve) | **GET** /api/invitations/{key} | Method returns details of an invitation -*IssuesApi* | [**issues_create**](docs/IssuesApi.md#issues_create) | **POST** /api/issues | Method creates an issue -*IssuesApi* | [**issues_destroy**](docs/IssuesApi.md#issues_destroy) | **DELETE** /api/issues/{id} | Method deletes an issue -*IssuesApi* | [**issues_list**](docs/IssuesApi.md#issues_list) | **GET** /api/issues | Method returns a paginated list of issues according to query parameters -*IssuesApi* | [**issues_list_comments**](docs/IssuesApi.md#issues_list_comments) | **GET** /api/issues/{id}/comments | The action returns all comments of a specific issue -*IssuesApi* | [**issues_partial_update**](docs/IssuesApi.md#issues_partial_update) | **PATCH** /api/issues/{id} | Methods does a partial update of chosen fields in an issue -*IssuesApi* | [**issues_retrieve**](docs/IssuesApi.md#issues_retrieve) | **GET** /api/issues/{id} | Method returns details of an issue -*JobsApi* | [**jobs_create_annotations**](docs/JobsApi.md#jobs_create_annotations) | **POST** /api/jobs/{id}/annotations/ | Method allows to upload job annotations -*JobsApi* | [**jobs_destroy_annotations**](docs/JobsApi.md#jobs_destroy_annotations) | **DELETE** /api/jobs/{id}/annotations/ | Method deletes all annotations for a specific job -*JobsApi* | [**jobs_list**](docs/JobsApi.md#jobs_list) | **GET** /api/jobs | Method returns a paginated list of jobs according to query parameters -*JobsApi* | [**jobs_list_commits**](docs/JobsApi.md#jobs_list_commits) | **GET** /api/jobs/{id}/commits | The action returns the list of tracked changes for the job -*JobsApi* | [**jobs_list_issues**](docs/JobsApi.md#jobs_list_issues) | **GET** /api/jobs/{id}/issues | Method returns list of issues for the job -*JobsApi* | [**jobs_partial_update**](docs/JobsApi.md#jobs_partial_update) | **PATCH** /api/jobs/{id} | Methods does a partial update of chosen fields in a job -*JobsApi* | [**jobs_partial_update_annotations**](docs/JobsApi.md#jobs_partial_update_annotations) | **PATCH** /api/jobs/{id}/annotations/ | Method performs a partial update of annotations in a specific job -*JobsApi* | [**jobs_partial_update_annotations_file**](docs/JobsApi.md#jobs_partial_update_annotations_file) | **PATCH** /api/jobs/{id}/annotations/{file_id} | Allows to upload an annotation file chunk. Implements TUS file uploading protocol. -*JobsApi* | [**jobs_retrieve**](docs/JobsApi.md#jobs_retrieve) | **GET** /api/jobs/{id} | Method returns details of a job -*JobsApi* | [**jobs_retrieve_annotations**](docs/JobsApi.md#jobs_retrieve_annotations) | **GET** /api/jobs/{id}/annotations/ | Method returns annotations for a specific job -*JobsApi* | [**jobs_retrieve_data**](docs/JobsApi.md#jobs_retrieve_data) | **GET** /api/jobs/{id}/data | Method returns data for a specific job -*JobsApi* | [**jobs_retrieve_data_meta**](docs/JobsApi.md#jobs_retrieve_data_meta) | **GET** /api/jobs/{id}/data/meta | Method provides a meta information about media files which are related with the job -*JobsApi* | [**jobs_retrieve_dataset**](docs/JobsApi.md#jobs_retrieve_dataset) | **GET** /api/jobs/{id}/dataset | Export job as a dataset in a specific format -*JobsApi* | [**jobs_update**](docs/JobsApi.md#jobs_update) | **PUT** /api/jobs/{id} | Method updates a job by id -*JobsApi* | [**jobs_update_annotations**](docs/JobsApi.md#jobs_update_annotations) | **PUT** /api/jobs/{id}/annotations/ | Method performs an update of all annotations in a specific job -*LambdaApi* | [**lambda_create_functions**](docs/LambdaApi.md#lambda_create_functions) | **POST** /api/lambda/functions/{func_id} | -*LambdaApi* | [**lambda_create_requests**](docs/LambdaApi.md#lambda_create_requests) | **POST** /api/lambda/requests | Method calls the function -*LambdaApi* | [**lambda_list_functions**](docs/LambdaApi.md#lambda_list_functions) | **GET** /api/lambda/functions | Method returns a list of functions -*LambdaApi* | [**lambda_list_requests**](docs/LambdaApi.md#lambda_list_requests) | **GET** /api/lambda/requests | Method returns a list of requests -*LambdaApi* | [**lambda_retrieve_functions**](docs/LambdaApi.md#lambda_retrieve_functions) | **GET** /api/lambda/functions/{func_id} | Method returns the information about the function -*LambdaApi* | [**lambda_retrieve_requests**](docs/LambdaApi.md#lambda_retrieve_requests) | **GET** /api/lambda/requests/{id} | Method returns the status of the request -*MembershipsApi* | [**memberships_destroy**](docs/MembershipsApi.md#memberships_destroy) | **DELETE** /api/memberships/{id} | Method deletes a membership -*MembershipsApi* | [**memberships_list**](docs/MembershipsApi.md#memberships_list) | **GET** /api/memberships | Method returns a paginated list of memberships according to query parameters -*MembershipsApi* | [**memberships_partial_update**](docs/MembershipsApi.md#memberships_partial_update) | **PATCH** /api/memberships/{id} | Methods does a partial update of chosen fields in a membership -*MembershipsApi* | [**memberships_retrieve**](docs/MembershipsApi.md#memberships_retrieve) | **GET** /api/memberships/{id} | Method returns details of a membership -*OrganizationsApi* | [**organizations_create**](docs/OrganizationsApi.md#organizations_create) | **POST** /api/organizations | Method creates an organization -*OrganizationsApi* | [**organizations_destroy**](docs/OrganizationsApi.md#organizations_destroy) | **DELETE** /api/organizations/{id} | Method deletes an organization -*OrganizationsApi* | [**organizations_list**](docs/OrganizationsApi.md#organizations_list) | **GET** /api/organizations | Method returns a paginated list of organizatins according to query parameters -*OrganizationsApi* | [**organizations_partial_update**](docs/OrganizationsApi.md#organizations_partial_update) | **PATCH** /api/organizations/{id} | Methods does a partial update of chosen fields in an organization -*OrganizationsApi* | [**organizations_retrieve**](docs/OrganizationsApi.md#organizations_retrieve) | **GET** /api/organizations/{id} | Method returns details of an organization -*ProjectsApi* | [**projects_create**](docs/ProjectsApi.md#projects_create) | **POST** /api/projects | Method creates a new project -*ProjectsApi* | [**projects_create_backup**](docs/ProjectsApi.md#projects_create_backup) | **POST** /api/projects/backup/ | Methods create a project from a backup -*ProjectsApi* | [**projects_create_dataset**](docs/ProjectsApi.md#projects_create_dataset) | **POST** /api/projects/{id}/dataset/ | Import dataset in specific format as a project -*ProjectsApi* | [**projects_destroy**](docs/ProjectsApi.md#projects_destroy) | **DELETE** /api/projects/{id} | Method deletes a specific project -*ProjectsApi* | [**projects_list**](docs/ProjectsApi.md#projects_list) | **GET** /api/projects | Returns a paginated list of projects according to query parameters (12 projects per page) -*ProjectsApi* | [**projects_list_tasks**](docs/ProjectsApi.md#projects_list_tasks) | **GET** /api/projects/{id}/tasks | Method returns information of the tasks of the project with the selected id -*ProjectsApi* | [**projects_partial_update**](docs/ProjectsApi.md#projects_partial_update) | **PATCH** /api/projects/{id} | Methods does a partial update of chosen fields in a project -*ProjectsApi* | [**projects_partial_update_backup_file**](docs/ProjectsApi.md#projects_partial_update_backup_file) | **PATCH** /api/projects/backup/{file_id} | Allows to upload a file chunk. Implements TUS file uploading protocol. -*ProjectsApi* | [**projects_partial_update_dataset_file**](docs/ProjectsApi.md#projects_partial_update_dataset_file) | **PATCH** /api/projects/{id}/dataset/{file_id} | Allows to upload a file chunk. Implements TUS file uploading protocol. -*ProjectsApi* | [**projects_retrieve**](docs/ProjectsApi.md#projects_retrieve) | **GET** /api/projects/{id} | Method returns details of a specific project -*ProjectsApi* | [**projects_retrieve_annotations**](docs/ProjectsApi.md#projects_retrieve_annotations) | **GET** /api/projects/{id}/annotations | Method allows to download project annotations -*ProjectsApi* | [**projects_retrieve_backup**](docs/ProjectsApi.md#projects_retrieve_backup) | **GET** /api/projects/{id}/backup | Methods creates a backup copy of a project -*ProjectsApi* | [**projects_retrieve_dataset**](docs/ProjectsApi.md#projects_retrieve_dataset) | **GET** /api/projects/{id}/dataset/ | Export project as a dataset in a specific format -*RestrictionsApi* | [**restrictions_retrieve_terms_of_use**](docs/RestrictionsApi.md#restrictions_retrieve_terms_of_use) | **GET** /api/restrictions/terms-of-use | Method provides CVAT terms of use -*RestrictionsApi* | [**restrictions_retrieve_user_agreements**](docs/RestrictionsApi.md#restrictions_retrieve_user_agreements) | **GET** /api/restrictions/user-agreements | Method provides user agreements that the user must accept to register -*SchemaApi* | [**schema_retrieve**](docs/SchemaApi.md#schema_retrieve) | **GET** /api/schema/ | -*ServerApi* | [**server_create_exception**](docs/ServerApi.md#server_create_exception) | **POST** /api/server/exception | Method saves an exception from a client on the server -*ServerApi* | [**server_create_logs**](docs/ServerApi.md#server_create_logs) | **POST** /api/server/logs | Method saves logs from a client on the server -*ServerApi* | [**server_list_share**](docs/ServerApi.md#server_list_share) | **GET** /api/server/share | Returns all files and folders that are on the server along specified path -*ServerApi* | [**server_retrieve_about**](docs/ServerApi.md#server_retrieve_about) | **GET** /api/server/about | Method provides basic CVAT information -*ServerApi* | [**server_retrieve_annotation_formats**](docs/ServerApi.md#server_retrieve_annotation_formats) | **GET** /api/server/annotation/formats | Method provides the list of supported annotations formats -*ServerApi* | [**server_retrieve_plugins**](docs/ServerApi.md#server_retrieve_plugins) | **GET** /api/server/plugins | Method provides allowed plugins -*TasksApi* | [**jobs_partial_update_data_meta**](docs/TasksApi.md#jobs_partial_update_data_meta) | **PATCH** /api/jobs/{id}/data/meta | Method provides a meta information about media files which are related with the job -*TasksApi* | [**tasks_create**](docs/TasksApi.md#tasks_create) | **POST** /api/tasks | Method creates a new task in a database without any attached images and videos -*TasksApi* | [**tasks_create_annotations**](docs/TasksApi.md#tasks_create_annotations) | **POST** /api/tasks/{id}/annotations/ | Method allows to upload task annotations from storage -*TasksApi* | [**tasks_create_backup**](docs/TasksApi.md#tasks_create_backup) | **POST** /api/tasks/backup/ | Method recreates a task from an attached task backup file -*TasksApi* | [**tasks_create_data**](docs/TasksApi.md#tasks_create_data) | **POST** /api/tasks/{id}/data/ | Method permanently attaches images or video to a task. Supports tus uploads, see more https://tus.io/ -*TasksApi* | [**tasks_destroy**](docs/TasksApi.md#tasks_destroy) | **DELETE** /api/tasks/{id} | Method deletes a specific task, all attached jobs, annotations, and data -*TasksApi* | [**tasks_destroy_annotations**](docs/TasksApi.md#tasks_destroy_annotations) | **DELETE** /api/tasks/{id}/annotations/ | Method deletes all annotations for a specific task -*TasksApi* | [**tasks_list**](docs/TasksApi.md#tasks_list) | **GET** /api/tasks | Returns a paginated list of tasks according to query parameters (10 tasks per page) -*TasksApi* | [**tasks_list_jobs**](docs/TasksApi.md#tasks_list_jobs) | **GET** /api/tasks/{id}/jobs | Method returns a list of jobs for a specific task -*TasksApi* | [**tasks_partial_update**](docs/TasksApi.md#tasks_partial_update) | **PATCH** /api/tasks/{id} | Methods does a partial update of chosen fields in a task -*TasksApi* | [**tasks_partial_update_annotations**](docs/TasksApi.md#tasks_partial_update_annotations) | **PATCH** /api/tasks/{id}/annotations/ | Method performs a partial update of annotations in a specific task -*TasksApi* | [**tasks_partial_update_annotations_file**](docs/TasksApi.md#tasks_partial_update_annotations_file) | **PATCH** /api/tasks/{id}/annotations/{file_id} | Allows to upload an annotation file chunk. Implements TUS file uploading protocol. -*TasksApi* | [**tasks_partial_update_backup_file**](docs/TasksApi.md#tasks_partial_update_backup_file) | **PATCH** /api/tasks/backup/{file_id} | Allows to upload a file chunk. Implements TUS file uploading protocol. -*TasksApi* | [**tasks_partial_update_data_file**](docs/TasksApi.md#tasks_partial_update_data_file) | **PATCH** /api/tasks/{id}/data/{file_id} | Allows to upload a file chunk. Implements TUS file uploading protocol. -*TasksApi* | [**tasks_partial_update_data_meta**](docs/TasksApi.md#tasks_partial_update_data_meta) | **PATCH** /api/tasks/{id}/data/meta | Method provides a meta information about media files which are related with the task -*TasksApi* | [**tasks_retrieve**](docs/TasksApi.md#tasks_retrieve) | **GET** /api/tasks/{id} | Method returns details of a specific task -*TasksApi* | [**tasks_retrieve_annotations**](docs/TasksApi.md#tasks_retrieve_annotations) | **GET** /api/tasks/{id}/annotations/ | Method allows to download task annotations -*TasksApi* | [**tasks_retrieve_backup**](docs/TasksApi.md#tasks_retrieve_backup) | **GET** /api/tasks/{id}/backup | Method backup a specified task -*TasksApi* | [**tasks_retrieve_data**](docs/TasksApi.md#tasks_retrieve_data) | **GET** /api/tasks/{id}/data/ | Method returns data for a specific task -*TasksApi* | [**tasks_retrieve_data_meta**](docs/TasksApi.md#tasks_retrieve_data_meta) | **GET** /api/tasks/{id}/data/meta | Method provides a meta information about media files which are related with the task -*TasksApi* | [**tasks_retrieve_dataset**](docs/TasksApi.md#tasks_retrieve_dataset) | **GET** /api/tasks/{id}/dataset | Export task as a dataset in a specific format -*TasksApi* | [**tasks_retrieve_status**](docs/TasksApi.md#tasks_retrieve_status) | **GET** /api/tasks/{id}/status | When task is being created the method returns information about a status of the creation process -*TasksApi* | [**tasks_update**](docs/TasksApi.md#tasks_update) | **PUT** /api/tasks/{id} | Method updates a task by id -*TasksApi* | [**tasks_update_annotations**](docs/TasksApi.md#tasks_update_annotations) | **PUT** /api/tasks/{id}/annotations/ | Method allows to upload task annotations -*UsersApi* | [**users_destroy**](docs/UsersApi.md#users_destroy) | **DELETE** /api/users/{id} | Method deletes a specific user from the server -*UsersApi* | [**users_list**](docs/UsersApi.md#users_list) | **GET** /api/users | Method provides a paginated list of users registered on the server -*UsersApi* | [**users_partial_update**](docs/UsersApi.md#users_partial_update) | **PATCH** /api/users/{id} | Method updates chosen fields of a user -*UsersApi* | [**users_retrieve**](docs/UsersApi.md#users_retrieve) | **GET** /api/users/{id} | Method provides information of a specific user -*UsersApi* | [**users_retrieve_self**](docs/UsersApi.md#users_retrieve_self) | **GET** /api/users/self | Method returns an instance of a user who is currently authorized - - -## Documentation For Models - - - [About](docs/About.md) - - [AnnotationFileRequest](docs/AnnotationFileRequest.md) - - [Attribute](docs/Attribute.md) - - [AttributeRequest](docs/AttributeRequest.md) - - [AttributeVal](docs/AttributeVal.md) - - [BasicUser](docs/BasicUser.md) - - [BasicUserRequest](docs/BasicUserRequest.md) - - [ChunkType](docs/ChunkType.md) - - [CloudStorageRead](docs/CloudStorageRead.md) - - [CloudStorageWrite](docs/CloudStorageWrite.md) - - [CloudStorageWriteRequest](docs/CloudStorageWriteRequest.md) - - [CommentRead](docs/CommentRead.md) - - [CommentReadOwner](docs/CommentReadOwner.md) - - [CommentWrite](docs/CommentWrite.md) - - [CommentWriteRequest](docs/CommentWriteRequest.md) - - [CredentialsTypeEnum](docs/CredentialsTypeEnum.md) - - [DataMetaRead](docs/DataMetaRead.md) - - [DataRequest](docs/DataRequest.md) - - [DatasetFileRequest](docs/DatasetFileRequest.md) - - [DatasetFormat](docs/DatasetFormat.md) - - [DatasetFormats](docs/DatasetFormats.md) - - [Exception](docs/Exception.md) - - [ExceptionRequest](docs/ExceptionRequest.md) - - [FileInfo](docs/FileInfo.md) - - [FileInfoTypeEnum](docs/FileInfoTypeEnum.md) - - [FrameMeta](docs/FrameMeta.md) - - [InputTypeEnum](docs/InputTypeEnum.md) - - [InvitationRead](docs/InvitationRead.md) - - [InvitationWrite](docs/InvitationWrite.md) - - [InvitationWriteRequest](docs/InvitationWriteRequest.md) - - [IssueRead](docs/IssueRead.md) - - [IssueWrite](docs/IssueWrite.md) - - [IssueWriteRequest](docs/IssueWriteRequest.md) - - [JobCommit](docs/JobCommit.md) - - [JobRead](docs/JobRead.md) - - [JobStage](docs/JobStage.md) - - [JobStatus](docs/JobStatus.md) - - [JobWrite](docs/JobWrite.md) - - [JobWriteRequest](docs/JobWriteRequest.md) - - [Label](docs/Label.md) - - [LabeledData](docs/LabeledData.md) - - [LabeledImage](docs/LabeledImage.md) - - [LabeledShape](docs/LabeledShape.md) - - [LabeledTrack](docs/LabeledTrack.md) - - [LocationEnum](docs/LocationEnum.md) - - [LogEvent](docs/LogEvent.md) - - [LogEventRequest](docs/LogEventRequest.md) - - [LoginRequest](docs/LoginRequest.md) - - [Manifest](docs/Manifest.md) - - [ManifestRequest](docs/ManifestRequest.md) - - [MembershipRead](docs/MembershipRead.md) - - [MembershipWrite](docs/MembershipWrite.md) - - [MetaUser](docs/MetaUser.md) - - [OperationStatus](docs/OperationStatus.md) - - [OrganizationRead](docs/OrganizationRead.md) - - [OrganizationWrite](docs/OrganizationWrite.md) - - [OrganizationWriteRequest](docs/OrganizationWriteRequest.md) - - [PaginatedCloudStorageReadList](docs/PaginatedCloudStorageReadList.md) - - [PaginatedCommentReadList](docs/PaginatedCommentReadList.md) - - [PaginatedInvitationReadList](docs/PaginatedInvitationReadList.md) - - [PaginatedIssueReadList](docs/PaginatedIssueReadList.md) - - [PaginatedJobCommitList](docs/PaginatedJobCommitList.md) - - [PaginatedJobReadList](docs/PaginatedJobReadList.md) - - [PaginatedMembershipReadList](docs/PaginatedMembershipReadList.md) - - [PaginatedMetaUserList](docs/PaginatedMetaUserList.md) - - [PaginatedPolymorphicProjectList](docs/PaginatedPolymorphicProjectList.md) - - [PaginatedTaskReadList](docs/PaginatedTaskReadList.md) - - [PasswordChangeRequest](docs/PasswordChangeRequest.md) - - [PasswordResetConfirmRequest](docs/PasswordResetConfirmRequest.md) - - [PasswordResetSerializerExRequest](docs/PasswordResetSerializerExRequest.md) - - [PatchedCloudStorageWriteRequest](docs/PatchedCloudStorageWriteRequest.md) - - [PatchedCommentWriteRequest](docs/PatchedCommentWriteRequest.md) - - [PatchedInvitationWriteRequest](docs/PatchedInvitationWriteRequest.md) - - [PatchedIssueWriteRequest](docs/PatchedIssueWriteRequest.md) - - [PatchedJobWriteRequest](docs/PatchedJobWriteRequest.md) - - [PatchedLabelRequest](docs/PatchedLabelRequest.md) - - [PatchedMembershipWriteRequest](docs/PatchedMembershipWriteRequest.md) - - [PatchedOrganizationWriteRequest](docs/PatchedOrganizationWriteRequest.md) - - [PatchedProjectWriteRequest](docs/PatchedProjectWriteRequest.md) - - [PatchedProjectWriteRequestTargetStorage](docs/PatchedProjectWriteRequestTargetStorage.md) - - [PatchedTaskWriteRequest](docs/PatchedTaskWriteRequest.md) - - [PatchedTaskWriteRequestTargetStorage](docs/PatchedTaskWriteRequestTargetStorage.md) - - [PatchedUserRequest](docs/PatchedUserRequest.md) - - [Plugins](docs/Plugins.md) - - [PolymorphicProject](docs/PolymorphicProject.md) - - [ProjectFileRequest](docs/ProjectFileRequest.md) - - [ProjectRead](docs/ProjectRead.md) - - [ProjectReadAssignee](docs/ProjectReadAssignee.md) - - [ProjectReadOwner](docs/ProjectReadOwner.md) - - [ProjectReadTargetStorage](docs/ProjectReadTargetStorage.md) - - [ProjectSearch](docs/ProjectSearch.md) - - [ProjectWrite](docs/ProjectWrite.md) - - [ProjectWriteRequest](docs/ProjectWriteRequest.md) - - [ProviderTypeEnum](docs/ProviderTypeEnum.md) - - [RestAuthDetail](docs/RestAuthDetail.md) - - [RestrictedRegister](docs/RestrictedRegister.md) - - [RestrictedRegisterRequest](docs/RestrictedRegisterRequest.md) - - [RoleEnum](docs/RoleEnum.md) - - [RqStatus](docs/RqStatus.md) - - [RqStatusStateEnum](docs/RqStatusStateEnum.md) - - [Segment](docs/Segment.md) - - [ShapeType](docs/ShapeType.md) - - [SigningRequest](docs/SigningRequest.md) - - [SimpleJob](docs/SimpleJob.md) - - [SortingMethod](docs/SortingMethod.md) - - [Storage](docs/Storage.md) - - [StorageMethod](docs/StorageMethod.md) - - [StorageRequest](docs/StorageRequest.md) - - [StorageType](docs/StorageType.md) - - [TaskFileRequest](docs/TaskFileRequest.md) - - [TaskRead](docs/TaskRead.md) - - [TaskReadTargetStorage](docs/TaskReadTargetStorage.md) - - [TaskWrite](docs/TaskWrite.md) - - [TaskWriteRequest](docs/TaskWriteRequest.md) - - [Token](docs/Token.md) - - [TrackedShape](docs/TrackedShape.md) - - [User](docs/User.md) - - [UserAgreement](docs/UserAgreement.md) - - [UserAgreementRequest](docs/UserAgreementRequest.md) - - -## Documentation For Authorization - - -## SignatureAuthentication - -- **Type**: API key -- **API key parameter name**: sign -- **Location**: URL query string - - -## basicAuth - -- **Type**: HTTP basic authentication - - -## cookieAuth - -- **Type**: API key -- **API key parameter name**: sessionid -- **Location**: - - -## tokenAuth - -- **Type**: API key -- **API key parameter name**: Authorization -- **Location**: HTTP header - - -## Author - -support@cvat.ai - - -## Notes for Large OpenAPI documents -If the OpenAPI document is large, imports in cvat_sdk.apis and cvat_sdk.models may fail with a -RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: - -Solution 1: -Use specific imports for apis and models like: -- `from cvat_sdk.api.default_api import DefaultApi` -- `from cvat_sdk.model.pet import Pet` - -Solution 2: -Before importing the package, adjust the maximum recursion limit as shown below: -``` -import sys -sys.setrecursionlimit(1500) -import cvat_sdk -from cvat_sdk.apis import * -from cvat_sdk.models import * -``` - diff --git a/cvat-sdk/cvat_sdk/__init__.py b/cvat-sdk/cvat_sdk/__init__.py index d728ffe6..1a6103ab 100644 --- a/cvat-sdk/cvat_sdk/__init__.py +++ b/cvat-sdk/cvat_sdk/__init__.py @@ -2,29 +2,5 @@ # # SPDX-License-Identifier: MIT -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -# import ApiClient -from cvat_sdk.api_client import ApiClient - -# import Configuration -from cvat_sdk.configuration import Configuration - -# import exceptions -from cvat_sdk.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) - -from .version import VERSION as __version__ +from cvat_sdk.core.client import Client, Config, make_client +from cvat_sdk.version import VERSION as __version__ diff --git a/cvat-sdk/cvat_sdk/api/__init__.py b/cvat-sdk/cvat_sdk/api/__init__.py deleted file mode 100644 index 6c9750c5..00000000 --- a/cvat-sdk/cvat_sdk/api/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - -# do not import all apis into this module because that uses a lot of memory and stack frames -# if you need the ability to import all apis from one package, import them with -# from cvat_sdk.apis import AuthApi diff --git a/cvat-sdk/cvat_sdk/api/auth_api.py b/cvat-sdk/cvat_sdk/api/auth_api.py deleted file mode 100644 index 5afd33fc..00000000 --- a/cvat-sdk/cvat_sdk/api/auth_api.py +++ /dev/null @@ -1,1002 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import typing -from typing import TYPE_CHECKING - -import urllib3 - -from cvat_sdk.api_client import ApiClient -from cvat_sdk.api_client import Endpoint as _Endpoint -from cvat_sdk.model.login_request import LoginRequest -from cvat_sdk.model.password_change_request import PasswordChangeRequest -from cvat_sdk.model.password_reset_confirm_request import PasswordResetConfirmRequest -from cvat_sdk.model.password_reset_serializer_ex_request import PasswordResetSerializerExRequest -from cvat_sdk.model.rest_auth_detail import RestAuthDetail -from cvat_sdk.model.restricted_register import RestrictedRegister -from cvat_sdk.model.restricted_register_request import RestrictedRegisterRequest -from cvat_sdk.model.signing_request import SigningRequest -from cvat_sdk.model.token import Token -from cvat_sdk.model_utils import date, datetime, file_type, none_type # noqa: F401 - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class AuthApi(object): - """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): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.create_login_endpoint = _Endpoint( - settings={ - "response_schema": (Token,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/auth/login", - "operation_id": "create_login", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "login_request", - "x_organization", - "org", - "org_id", - ], - "required": [ - "login_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "login_request": (LoginRequest,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "login_request": "body", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.create_logout_endpoint = _Endpoint( - settings={ - "response_schema": (RestAuthDetail,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/auth/logout", - "operation_id": "create_logout", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "org", - "org_id", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.create_password_change_endpoint = _Endpoint( - settings={ - "response_schema": (RestAuthDetail,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/auth/password/change", - "operation_id": "create_password_change", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "password_change_request", - "x_organization", - "org", - "org_id", - ], - "required": [ - "password_change_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "password_change_request": (PasswordChangeRequest,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "password_change_request": "body", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.create_password_reset_endpoint = _Endpoint( - settings={ - "response_schema": (RestAuthDetail,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/auth/password/reset", - "operation_id": "create_password_reset", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "password_reset_serializer_ex_request", - "x_organization", - "org", - "org_id", - ], - "required": [ - "password_reset_serializer_ex_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "password_reset_serializer_ex_request": (PasswordResetSerializerExRequest,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "password_reset_serializer_ex_request": "body", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.create_password_reset_confirm_endpoint = _Endpoint( - settings={ - "response_schema": (RestAuthDetail,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/auth/password/reset/confirm", - "operation_id": "create_password_reset_confirm", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "password_reset_confirm_request", - "x_organization", - "org", - "org_id", - ], - "required": [ - "password_reset_confirm_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "password_reset_confirm_request": (PasswordResetConfirmRequest,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "password_reset_confirm_request": "body", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.create_register_endpoint = _Endpoint( - settings={ - "response_schema": (RestrictedRegister,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/auth/register", - "operation_id": "create_register", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "restricted_register_request", - "x_organization", - "org", - "org_id", - ], - "required": [ - "restricted_register_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "restricted_register_request": (RestrictedRegisterRequest,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "restricted_register_request": "body", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.create_signing_endpoint = _Endpoint( - settings={ - "response_schema": (str,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/auth/signing", - "operation_id": "create_signing", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "signing_request", - "x_organization", - "org", - "org_id", - ], - "required": [ - "signing_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "signing_request": (SigningRequest,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "signing_request": "body", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - - def create_login( - self, - login_request: LoginRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[Token], urllib3.HTTPResponse]: - """create_login # noqa: E501 - - Check the credentials and return the REST Token if the credentials are valid and authenticated. Calls Django Auth login method to register User ID in Django session framework Accept the following POST parameters: username, password Return the REST Framework Token Object's key. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create_login(login_request, _async_call=True) - >>> result = thread.get() - - Args: - login_request (LoginRequest): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (Token, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["login_request"] = login_request - return self.create_login_endpoint.call_with_http_info(**kwargs) - - def create_logout( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[RestAuthDetail], urllib3.HTTPResponse]: - """create_logout # noqa: E501 - - Calls Django logout method and delete the Token object assigned to the current User object. Accepts/Returns nothing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create_logout(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (RestAuthDetail, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.create_logout_endpoint.call_with_http_info(**kwargs) - - def create_password_change( - self, - password_change_request: PasswordChangeRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[RestAuthDetail], urllib3.HTTPResponse]: - """create_password_change # noqa: E501 - - Calls Django Auth SetPasswordForm save method. Accepts the following POST parameters: new_password1, new_password2 Returns the success/fail message. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create_password_change(password_change_request, _async_call=True) - >>> result = thread.get() - - Args: - password_change_request (PasswordChangeRequest): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (RestAuthDetail, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["password_change_request"] = password_change_request - return self.create_password_change_endpoint.call_with_http_info(**kwargs) - - def create_password_reset( - self, - password_reset_serializer_ex_request: PasswordResetSerializerExRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[RestAuthDetail], urllib3.HTTPResponse]: - """create_password_reset # noqa: E501 - - Calls Django Auth PasswordResetForm save method. Accepts the following POST parameters: email Returns the success/fail message. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create_password_reset(password_reset_serializer_ex_request, _async_call=True) - >>> result = thread.get() - - Args: - password_reset_serializer_ex_request (PasswordResetSerializerExRequest): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (RestAuthDetail, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["password_reset_serializer_ex_request"] = password_reset_serializer_ex_request - return self.create_password_reset_endpoint.call_with_http_info(**kwargs) - - def create_password_reset_confirm( - self, - password_reset_confirm_request: PasswordResetConfirmRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[RestAuthDetail], urllib3.HTTPResponse]: - """create_password_reset_confirm # noqa: E501 - - Password reset e-mail link is confirmed, therefore this resets the user's password. Accepts the following POST parameters: token, uid, new_password1, new_password2 Returns the success/fail message. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create_password_reset_confirm(password_reset_confirm_request, _async_call=True) - >>> result = thread.get() - - Args: - password_reset_confirm_request (PasswordResetConfirmRequest): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (RestAuthDetail, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["password_reset_confirm_request"] = password_reset_confirm_request - return self.create_password_reset_confirm_endpoint.call_with_http_info(**kwargs) - - def create_register( - self, - restricted_register_request: RestrictedRegisterRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[RestrictedRegister], urllib3.HTTPResponse]: - """create_register # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create_register(restricted_register_request, _async_call=True) - >>> result = thread.get() - - Args: - restricted_register_request (RestrictedRegisterRequest): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (RestrictedRegister, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["restricted_register_request"] = restricted_register_request - return self.create_register_endpoint.call_with_http_info(**kwargs) - - def create_signing( - self, - signing_request: SigningRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[str], urllib3.HTTPResponse]: - """This method signs URL for access to the server # noqa: E501 - - Signed URL contains a token which authenticates a user on the server.Signed URL is valid during 30 seconds since signing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create_signing(signing_request, _async_call=True) - >>> result = thread.get() - - Args: - signing_request (SigningRequest): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (str, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["signing_request"] = signing_request - return self.create_signing_endpoint.call_with_http_info(**kwargs) diff --git a/cvat-sdk/cvat_sdk/api/cloud_storages_api.py b/cvat-sdk/cvat_sdk/api/cloud_storages_api.py deleted file mode 100644 index 25027c63..00000000 --- a/cvat-sdk/cvat_sdk/api/cloud_storages_api.py +++ /dev/null @@ -1,1278 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import typing -from typing import TYPE_CHECKING - -import urllib3 - -from cvat_sdk.api_client import ApiClient -from cvat_sdk.api_client import Endpoint as _Endpoint -from cvat_sdk.model.cloud_storage_read import CloudStorageRead -from cvat_sdk.model.cloud_storage_write import CloudStorageWrite -from cvat_sdk.model.cloud_storage_write_request import CloudStorageWriteRequest -from cvat_sdk.model.paginated_cloud_storage_read_list import PaginatedCloudStorageReadList -from cvat_sdk.model.patched_cloud_storage_write_request import PatchedCloudStorageWriteRequest -from cvat_sdk.model_utils import date, datetime, file_type, none_type # noqa: F401 - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class CloudStoragesApi(object): - """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): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.cloudstorages_create_endpoint = _Endpoint( - settings={ - "response_schema": (CloudStorageWrite,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/cloudstorages", - "operation_id": "cloudstorages_create", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "cloud_storage_write_request", - "x_organization", - "org", - "org_id", - ], - "required": [ - "cloud_storage_write_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "cloud_storage_write_request": (CloudStorageWriteRequest,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "cloud_storage_write_request": "body", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.cloudstorages_destroy_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/cloudstorages/{id}", - "operation_id": "cloudstorages_destroy", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.cloudstorages_list_endpoint = _Endpoint( - settings={ - "response_schema": (PaginatedCloudStorageReadList,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/cloudstorages", - "operation_id": "cloudstorages_list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "filter", - "org", - "org_id", - "page", - "page_size", - "search", - "sort", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "filter": (str,), - "org": (str,), - "org_id": (int,), - "page": (int,), - "page_size": (int,), - "search": (str,), - "sort": (str,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "filter": "filter", - "org": "org", - "org_id": "org_id", - "page": "page", - "page_size": "page_size", - "search": "search", - "sort": "sort", - }, - "location_map": { - "x_organization": "header", - "filter": "query", - "org": "query", - "org_id": "query", - "page": "query", - "page_size": "query", - "search": "query", - "sort": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.cloudstorages_partial_update_endpoint = _Endpoint( - settings={ - "response_schema": (CloudStorageWrite,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/cloudstorages/{id}", - "operation_id": "cloudstorages_partial_update", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - "patched_cloud_storage_write_request", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "patched_cloud_storage_write_request": (PatchedCloudStorageWriteRequest,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "patched_cloud_storage_write_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.cloudstorages_retrieve_endpoint = _Endpoint( - settings={ - "response_schema": (CloudStorageRead,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/cloudstorages/{id}", - "operation_id": "cloudstorages_retrieve", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.cloudstorages_retrieve_actions_endpoint = _Endpoint( - settings={ - "response_schema": (str,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/cloudstorages/{id}/actions", - "operation_id": "cloudstorages_retrieve_actions", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.cloudstorages_retrieve_content_endpoint = _Endpoint( - settings={ - "response_schema": ([str],), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/cloudstorages/{id}/content", - "operation_id": "cloudstorages_retrieve_content", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "manifest_path", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "manifest_path": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "manifest_path": "manifest_path", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "manifest_path": "query", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.cloudstorages_retrieve_preview_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/cloudstorages/{id}/preview", - "operation_id": "cloudstorages_retrieve_preview", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.cloudstorages_retrieve_status_endpoint = _Endpoint( - settings={ - "response_schema": (str,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/cloudstorages/{id}/status", - "operation_id": "cloudstorages_retrieve_status", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - - def cloudstorages_create( - self, - cloud_storage_write_request: CloudStorageWriteRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[CloudStorageWrite], urllib3.HTTPResponse]: - """Method creates a cloud storage with a specified characteristics # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.cloudstorages_create(cloud_storage_write_request, _async_call=True) - >>> result = thread.get() - - Args: - cloud_storage_write_request (CloudStorageWriteRequest): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (CloudStorageWrite, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["cloud_storage_write_request"] = cloud_storage_write_request - return self.cloudstorages_create_endpoint.call_with_http_info(**kwargs) - - def cloudstorages_destroy( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method deletes a specific cloud storage # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.cloudstorages_destroy(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this cloud storage. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.cloudstorages_destroy_endpoint.call_with_http_info(**kwargs) - - def cloudstorages_list( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[PaginatedCloudStorageReadList], urllib3.HTTPResponse]: - """Returns a paginated list of storages according to query parameters # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.cloudstorages_list(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - filter (str): A filter term. Avaliable filter_fields: ['provider_type', 'display_name', 'resource', 'credentials_type', 'owner', 'description', 'id']. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - page (int): A page number within the paginated result set.. [optional] - page_size (int): Number of results to return per page.. [optional] - search (str): A search term. Avaliable search_fields: ('provider_type', 'display_name', 'resource', 'credentials_type', 'owner', 'description'). [optional] - sort (str): Which field to use when ordering the results. Avaliable ordering_fields: ['provider_type', 'display_name', 'resource', 'credentials_type', 'owner', 'description', 'id']. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (PaginatedCloudStorageReadList, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.cloudstorages_list_endpoint.call_with_http_info(**kwargs) - - def cloudstorages_partial_update( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[CloudStorageWrite], urllib3.HTTPResponse]: - """Methods does a partial update of chosen fields in a cloud storage instance # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.cloudstorages_partial_update(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this cloud storage. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - patched_cloud_storage_write_request (PatchedCloudStorageWriteRequest): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (CloudStorageWrite, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.cloudstorages_partial_update_endpoint.call_with_http_info(**kwargs) - - def cloudstorages_retrieve( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[CloudStorageRead], urllib3.HTTPResponse]: - """Method returns details of a specific cloud storage # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.cloudstorages_retrieve(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this cloud storage. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (CloudStorageRead, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.cloudstorages_retrieve_endpoint.call_with_http_info(**kwargs) - - def cloudstorages_retrieve_actions( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[str], urllib3.HTTPResponse]: - """Method returns allowed actions for the cloud storage # noqa: E501 - - Method return allowed actions for cloud storage. It's required for reading/writing # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.cloudstorages_retrieve_actions(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this cloud storage. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (str, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.cloudstorages_retrieve_actions_endpoint.call_with_http_info(**kwargs) - - def cloudstorages_retrieve_content( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[typing.List[str]], urllib3.HTTPResponse]: - """Method returns a manifest content # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.cloudstorages_retrieve_content(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this cloud storage. - - Keyword Args: - x_organization (str): [optional] - manifest_path (str): Path to the manifest file in a cloud storage. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - ([str], HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.cloudstorages_retrieve_content_endpoint.call_with_http_info(**kwargs) - - def cloudstorages_retrieve_preview( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method returns a preview image from a cloud storage # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.cloudstorages_retrieve_preview(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this cloud storage. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.cloudstorages_retrieve_preview_endpoint.call_with_http_info(**kwargs) - - def cloudstorages_retrieve_status( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[str], urllib3.HTTPResponse]: - """Method returns a cloud storage status # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.cloudstorages_retrieve_status(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this cloud storage. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (str, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.cloudstorages_retrieve_status_endpoint.call_with_http_info(**kwargs) diff --git a/cvat-sdk/cvat_sdk/api/comments_api.py b/cvat-sdk/cvat_sdk/api/comments_api.py deleted file mode 100644 index d7d3fefb..00000000 --- a/cvat-sdk/cvat_sdk/api/comments_api.py +++ /dev/null @@ -1,740 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import typing -from typing import TYPE_CHECKING - -import urllib3 - -from cvat_sdk.api_client import ApiClient -from cvat_sdk.api_client import Endpoint as _Endpoint -from cvat_sdk.model.comment_read import CommentRead -from cvat_sdk.model.comment_write import CommentWrite -from cvat_sdk.model.comment_write_request import CommentWriteRequest -from cvat_sdk.model.paginated_comment_read_list import PaginatedCommentReadList -from cvat_sdk.model.patched_comment_write_request import PatchedCommentWriteRequest -from cvat_sdk.model_utils import date, datetime, file_type, none_type # noqa: F401 - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class CommentsApi(object): - """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): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.create_endpoint = _Endpoint( - settings={ - "response_schema": (CommentWrite,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/comments", - "operation_id": "create", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "comment_write_request", - "x_organization", - "org", - "org_id", - ], - "required": [ - "comment_write_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "comment_write_request": (CommentWriteRequest,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "comment_write_request": "body", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.destroy_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/comments/{id}", - "operation_id": "destroy", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.list_endpoint = _Endpoint( - settings={ - "response_schema": (PaginatedCommentReadList,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/comments", - "operation_id": "list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "filter", - "org", - "org_id", - "page", - "page_size", - "search", - "sort", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "filter": (str,), - "org": (str,), - "org_id": (int,), - "page": (int,), - "page_size": (int,), - "search": (str,), - "sort": (str,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "filter": "filter", - "org": "org", - "org_id": "org_id", - "page": "page", - "page_size": "page_size", - "search": "search", - "sort": "sort", - }, - "location_map": { - "x_organization": "header", - "filter": "query", - "org": "query", - "org_id": "query", - "page": "query", - "page_size": "query", - "search": "query", - "sort": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.partial_update_endpoint = _Endpoint( - settings={ - "response_schema": (CommentWrite,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/comments/{id}", - "operation_id": "partial_update", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - "patched_comment_write_request", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "patched_comment_write_request": (PatchedCommentWriteRequest,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "patched_comment_write_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.retrieve_endpoint = _Endpoint( - settings={ - "response_schema": (CommentRead,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/comments/{id}", - "operation_id": "retrieve", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - - def create( - self, - comment_write_request: CommentWriteRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[CommentWrite], urllib3.HTTPResponse]: - """Method creates a comment # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create(comment_write_request, _async_call=True) - >>> result = thread.get() - - Args: - comment_write_request (CommentWriteRequest): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (CommentWrite, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["comment_write_request"] = comment_write_request - return self.create_endpoint.call_with_http_info(**kwargs) - - def destroy( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method deletes a comment # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.destroy(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this comment. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.destroy_endpoint.call_with_http_info(**kwargs) - - def list( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[PaginatedCommentReadList], urllib3.HTTPResponse]: - """Method returns a paginated list of comments according to query parameters # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.list(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - filter (str): A filter term. Avaliable filter_fields: ['owner', 'id', 'issue_id']. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - page (int): A page number within the paginated result set.. [optional] - page_size (int): Number of results to return per page.. [optional] - search (str): A search term. Avaliable search_fields: ('owner',). [optional] - sort (str): Which field to use when ordering the results. Avaliable ordering_fields: ['owner', 'id', 'issue_id']. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (PaginatedCommentReadList, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.list_endpoint.call_with_http_info(**kwargs) - - def partial_update( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[CommentWrite], urllib3.HTTPResponse]: - """Methods does a partial update of chosen fields in a comment # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.partial_update(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this comment. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - patched_comment_write_request (PatchedCommentWriteRequest): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (CommentWrite, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.partial_update_endpoint.call_with_http_info(**kwargs) - - def retrieve( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[CommentRead], urllib3.HTTPResponse]: - """Method returns details of a comment # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this comment. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (CommentRead, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.retrieve_endpoint.call_with_http_info(**kwargs) diff --git a/cvat-sdk/cvat_sdk/api/invitations_api.py b/cvat-sdk/cvat_sdk/api/invitations_api.py deleted file mode 100644 index 5218ca0d..00000000 --- a/cvat-sdk/cvat_sdk/api/invitations_api.py +++ /dev/null @@ -1,740 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import typing -from typing import TYPE_CHECKING - -import urllib3 - -from cvat_sdk.api_client import ApiClient -from cvat_sdk.api_client import Endpoint as _Endpoint -from cvat_sdk.model.invitation_read import InvitationRead -from cvat_sdk.model.invitation_write import InvitationWrite -from cvat_sdk.model.invitation_write_request import InvitationWriteRequest -from cvat_sdk.model.paginated_invitation_read_list import PaginatedInvitationReadList -from cvat_sdk.model.patched_invitation_write_request import PatchedInvitationWriteRequest -from cvat_sdk.model_utils import date, datetime, file_type, none_type # noqa: F401 - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class InvitationsApi(object): - """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): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.create_endpoint = _Endpoint( - settings={ - "response_schema": (InvitationWrite,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/invitations", - "operation_id": "create", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "invitation_write_request", - "x_organization", - "org", - "org_id", - ], - "required": [ - "invitation_write_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "invitation_write_request": (InvitationWriteRequest,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "invitation_write_request": "body", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.destroy_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/invitations/{key}", - "operation_id": "destroy", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "key", - "x_organization", - "org", - "org_id", - ], - "required": [ - "key", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "key": (str,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "key": "key", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "key": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.list_endpoint = _Endpoint( - settings={ - "response_schema": (PaginatedInvitationReadList,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/invitations", - "operation_id": "list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "filter", - "org", - "org_id", - "page", - "page_size", - "search", - "sort", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "filter": (str,), - "org": (str,), - "org_id": (int,), - "page": (int,), - "page_size": (int,), - "search": (str,), - "sort": (str,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "filter": "filter", - "org": "org", - "org_id": "org_id", - "page": "page", - "page_size": "page_size", - "search": "search", - "sort": "sort", - }, - "location_map": { - "x_organization": "header", - "filter": "query", - "org": "query", - "org_id": "query", - "page": "query", - "page_size": "query", - "search": "query", - "sort": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.partial_update_endpoint = _Endpoint( - settings={ - "response_schema": (InvitationWrite,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/invitations/{key}", - "operation_id": "partial_update", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "key", - "x_organization", - "org", - "org_id", - "patched_invitation_write_request", - ], - "required": [ - "key", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "key": (str,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "patched_invitation_write_request": (PatchedInvitationWriteRequest,), - }, - "attribute_map": { - "key": "key", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "key": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "patched_invitation_write_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.retrieve_endpoint = _Endpoint( - settings={ - "response_schema": (InvitationRead,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/invitations/{key}", - "operation_id": "retrieve", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "key", - "x_organization", - "org", - "org_id", - ], - "required": [ - "key", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "key": (str,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "key": "key", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "key": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - - def create( - self, - invitation_write_request: InvitationWriteRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[InvitationWrite], urllib3.HTTPResponse]: - """Method creates an invitation # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create(invitation_write_request, _async_call=True) - >>> result = thread.get() - - Args: - invitation_write_request (InvitationWriteRequest): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (InvitationWrite, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["invitation_write_request"] = invitation_write_request - return self.create_endpoint.call_with_http_info(**kwargs) - - def destroy( - self, - key: str, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method deletes an invitation # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.destroy(key, _async_call=True) - >>> result = thread.get() - - Args: - key (str): A unique value identifying this invitation. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["key"] = key - return self.destroy_endpoint.call_with_http_info(**kwargs) - - def list( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[PaginatedInvitationReadList], urllib3.HTTPResponse]: - """Method returns a paginated list of invitations according to query parameters # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.list(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - filter (str): A filter term. Avaliable filter_fields: ('owner',). [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - page (int): A page number within the paginated result set.. [optional] - page_size (int): Number of results to return per page.. [optional] - search (str): A search term. Avaliable search_fields: ('owner',). [optional] - sort (str): Which field to use when ordering the results. Avaliable ordering_fields: ['owner', 'created_date']. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (PaginatedInvitationReadList, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.list_endpoint.call_with_http_info(**kwargs) - - def partial_update( - self, - key: str, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[InvitationWrite], urllib3.HTTPResponse]: - """Methods does a partial update of chosen fields in an invitation # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.partial_update(key, _async_call=True) - >>> result = thread.get() - - Args: - key (str): A unique value identifying this invitation. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - patched_invitation_write_request (PatchedInvitationWriteRequest): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (InvitationWrite, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["key"] = key - return self.partial_update_endpoint.call_with_http_info(**kwargs) - - def retrieve( - self, - key: str, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[InvitationRead], urllib3.HTTPResponse]: - """Method returns details of an invitation # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve(key, _async_call=True) - >>> result = thread.get() - - Args: - key (str): A unique value identifying this invitation. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (InvitationRead, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["key"] = key - return self.retrieve_endpoint.call_with_http_info(**kwargs) diff --git a/cvat-sdk/cvat_sdk/api/issues_api.py b/cvat-sdk/cvat_sdk/api/issues_api.py deleted file mode 100644 index 095b49d6..00000000 --- a/cvat-sdk/cvat_sdk/api/issues_api.py +++ /dev/null @@ -1,899 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import typing -from typing import TYPE_CHECKING - -import urllib3 - -from cvat_sdk.api_client import ApiClient -from cvat_sdk.api_client import Endpoint as _Endpoint -from cvat_sdk.model.issue_read import IssueRead -from cvat_sdk.model.issue_write import IssueWrite -from cvat_sdk.model.issue_write_request import IssueWriteRequest -from cvat_sdk.model.paginated_comment_read_list import PaginatedCommentReadList -from cvat_sdk.model.paginated_issue_read_list import PaginatedIssueReadList -from cvat_sdk.model.patched_issue_write_request import PatchedIssueWriteRequest -from cvat_sdk.model_utils import date, datetime, file_type, none_type # noqa: F401 - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class IssuesApi(object): - """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): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.create_endpoint = _Endpoint( - settings={ - "response_schema": (IssueWrite,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/issues", - "operation_id": "create", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "issue_write_request", - "x_organization", - "org", - "org_id", - ], - "required": [ - "issue_write_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "issue_write_request": (IssueWriteRequest,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "issue_write_request": "body", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.destroy_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/issues/{id}", - "operation_id": "destroy", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.list_endpoint = _Endpoint( - settings={ - "response_schema": (PaginatedIssueReadList,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/issues", - "operation_id": "list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "filter", - "org", - "org_id", - "page", - "page_size", - "search", - "sort", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "filter": (str,), - "org": (str,), - "org_id": (int,), - "page": (int,), - "page_size": (int,), - "search": (str,), - "sort": (str,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "filter": "filter", - "org": "org", - "org_id": "org_id", - "page": "page", - "page_size": "page_size", - "search": "search", - "sort": "sort", - }, - "location_map": { - "x_organization": "header", - "filter": "query", - "org": "query", - "org_id": "query", - "page": "query", - "page_size": "query", - "search": "query", - "sort": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.list_comments_endpoint = _Endpoint( - settings={ - "response_schema": (PaginatedCommentReadList,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/issues/{id}/comments", - "operation_id": "list_comments", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "filter", - "org", - "org_id", - "page", - "page_size", - "search", - "sort", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "filter": (str,), - "org": (str,), - "org_id": (int,), - "page": (int,), - "page_size": (int,), - "search": (str,), - "sort": (str,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "filter": "filter", - "org": "org", - "org_id": "org_id", - "page": "page", - "page_size": "page_size", - "search": "search", - "sort": "sort", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "filter": "query", - "org": "query", - "org_id": "query", - "page": "query", - "page_size": "query", - "search": "query", - "sort": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.partial_update_endpoint = _Endpoint( - settings={ - "response_schema": (IssueWrite,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/issues/{id}", - "operation_id": "partial_update", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - "patched_issue_write_request", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "patched_issue_write_request": (PatchedIssueWriteRequest,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "patched_issue_write_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.retrieve_endpoint = _Endpoint( - settings={ - "response_schema": (IssueRead,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/issues/{id}", - "operation_id": "retrieve", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - - def create( - self, - issue_write_request: IssueWriteRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[IssueWrite], urllib3.HTTPResponse]: - """Method creates an issue # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create(issue_write_request, _async_call=True) - >>> result = thread.get() - - Args: - issue_write_request (IssueWriteRequest): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (IssueWrite, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["issue_write_request"] = issue_write_request - return self.create_endpoint.call_with_http_info(**kwargs) - - def destroy( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method deletes an issue # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.destroy(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this issue. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.destroy_endpoint.call_with_http_info(**kwargs) - - def list( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[PaginatedIssueReadList], urllib3.HTTPResponse]: - """Method returns a paginated list of issues according to query parameters # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.list(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - filter (str): A filter term. Avaliable filter_fields: ['owner', 'assignee', 'id', 'job_id', 'task_id', 'resolved']. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - page (int): A page number within the paginated result set.. [optional] - page_size (int): Number of results to return per page.. [optional] - search (str): A search term. Avaliable search_fields: ('owner', 'assignee'). [optional] - sort (str): Which field to use when ordering the results. Avaliable ordering_fields: ['owner', 'assignee', 'id', 'job_id', 'task_id', 'resolved']. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (PaginatedIssueReadList, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.list_endpoint.call_with_http_info(**kwargs) - - def list_comments( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[PaginatedCommentReadList], urllib3.HTTPResponse]: - """The action returns all comments of a specific issue # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.list_comments(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this issue. - - Keyword Args: - x_organization (str): [optional] - filter (str): A filter term. Avaliable filter_fields: ['owner', 'assignee', 'id', 'job_id', 'task_id', 'resolved']. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - page (int): A page number within the paginated result set.. [optional] - page_size (int): Number of results to return per page.. [optional] - search (str): A search term. Avaliable search_fields: ('owner', 'assignee'). [optional] - sort (str): Which field to use when ordering the results. Avaliable ordering_fields: ['owner', 'assignee', 'id', 'job_id', 'task_id', 'resolved']. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (PaginatedCommentReadList, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.list_comments_endpoint.call_with_http_info(**kwargs) - - def partial_update( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[IssueWrite], urllib3.HTTPResponse]: - """Methods does a partial update of chosen fields in an issue # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.partial_update(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this issue. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - patched_issue_write_request (PatchedIssueWriteRequest): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (IssueWrite, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.partial_update_endpoint.call_with_http_info(**kwargs) - - def retrieve( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[IssueRead], urllib3.HTTPResponse]: - """Method returns details of an issue # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this issue. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (IssueRead, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.retrieve_endpoint.call_with_http_info(**kwargs) diff --git a/cvat-sdk/cvat_sdk/api/jobs_api.py b/cvat-sdk/cvat_sdk/api/jobs_api.py deleted file mode 100644 index 967e71be..00000000 --- a/cvat-sdk/cvat_sdk/api/jobs_api.py +++ /dev/null @@ -1,2336 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import typing -from typing import TYPE_CHECKING - -import urllib3 - -from cvat_sdk.api_client import ApiClient -from cvat_sdk.api_client import Endpoint as _Endpoint -from cvat_sdk.model.annotation_file_request import AnnotationFileRequest -from cvat_sdk.model.data_meta_read import DataMetaRead -from cvat_sdk.model.job_read import JobRead -from cvat_sdk.model.job_write import JobWrite -from cvat_sdk.model.job_write_request import JobWriteRequest -from cvat_sdk.model.labeled_data import LabeledData -from cvat_sdk.model.paginated_issue_read_list import PaginatedIssueReadList -from cvat_sdk.model.paginated_job_commit_list import PaginatedJobCommitList -from cvat_sdk.model.paginated_job_read_list import PaginatedJobReadList -from cvat_sdk.model.patched_job_write_request import PatchedJobWriteRequest -from cvat_sdk.model_utils import date, datetime, file_type, none_type # noqa: F401 - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class JobsApi(object): - """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): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.create_annotations_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/jobs/{id}/annotations/", - "operation_id": "create_annotations", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "cloud_storage_id", - "filename", - "format", - "location", - "org", - "org_id", - "use_default_location", - "job_write_request", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [ - "location", - ], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": { - ("location",): {"CLOUD_STORAGE": "cloud_storage", "LOCAL": "local"}, - }, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "cloud_storage_id": (float,), - "filename": (str,), - "format": (str,), - "location": (str,), - "org": (str,), - "org_id": (int,), - "use_default_location": (bool,), - "job_write_request": (JobWriteRequest,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "cloud_storage_id": "cloud_storage_id", - "filename": "filename", - "format": "format", - "location": "location", - "org": "org", - "org_id": "org_id", - "use_default_location": "use_default_location", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "cloud_storage_id": "query", - "filename": "query", - "format": "query", - "location": "query", - "org": "query", - "org_id": "query", - "use_default_location": "query", - "job_write_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.destroy_annotations_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/jobs/{id}/annotations/", - "operation_id": "destroy_annotations", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.list_endpoint = _Endpoint( - settings={ - "response_schema": (PaginatedJobReadList,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/jobs", - "operation_id": "list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "filter", - "org", - "org_id", - "page", - "page_size", - "search", - "sort", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "filter": (str,), - "org": (str,), - "org_id": (int,), - "page": (int,), - "page_size": (int,), - "search": (str,), - "sort": (str,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "filter": "filter", - "org": "org", - "org_id": "org_id", - "page": "page", - "page_size": "page_size", - "search": "search", - "sort": "sort", - }, - "location_map": { - "x_organization": "header", - "filter": "query", - "org": "query", - "org_id": "query", - "page": "query", - "page_size": "query", - "search": "query", - "sort": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.list_commits_endpoint = _Endpoint( - settings={ - "response_schema": (PaginatedJobCommitList,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/jobs/{id}/commits", - "operation_id": "list_commits", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "filter", - "org", - "org_id", - "page", - "page_size", - "search", - "sort", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "filter": (str,), - "org": (str,), - "org_id": (int,), - "page": (int,), - "page_size": (int,), - "search": (str,), - "sort": (str,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "filter": "filter", - "org": "org", - "org_id": "org_id", - "page": "page", - "page_size": "page_size", - "search": "search", - "sort": "sort", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "filter": "query", - "org": "query", - "org_id": "query", - "page": "query", - "page_size": "query", - "search": "query", - "sort": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.list_issues_endpoint = _Endpoint( - settings={ - "response_schema": (PaginatedIssueReadList,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/jobs/{id}/issues", - "operation_id": "list_issues", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "filter", - "org", - "org_id", - "page", - "page_size", - "search", - "sort", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "filter": (str,), - "org": (str,), - "org_id": (int,), - "page": (int,), - "page_size": (int,), - "search": (str,), - "sort": (str,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "filter": "filter", - "org": "org", - "org_id": "org_id", - "page": "page", - "page_size": "page_size", - "search": "search", - "sort": "sort", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "filter": "query", - "org": "query", - "org_id": "query", - "page": "query", - "page_size": "query", - "search": "query", - "sort": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.partial_update_endpoint = _Endpoint( - settings={ - "response_schema": (JobWrite,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/jobs/{id}", - "operation_id": "partial_update", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - "patched_job_write_request", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "patched_job_write_request": (PatchedJobWriteRequest,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "patched_job_write_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.partial_update_annotations_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/jobs/{id}/annotations/", - "operation_id": "partial_update_annotations", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "action", - "id", - "x_organization", - "org", - "org_id", - "patched_job_write_request", - ], - "required": [ - "action", - "id", - ], - "nullable": [], - "enum": [ - "action", - ], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": { - ("action",): {"CREATE": "create", "DELETE": "delete", "UPDATE": "update"}, - }, - "openapi_types": { - "action": (str,), - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "patched_job_write_request": (PatchedJobWriteRequest,), - }, - "attribute_map": { - "action": "action", - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "action": "query", - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "patched_job_write_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.partial_update_annotations_file_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/jobs/{id}/annotations/{file_id}", - "operation_id": "partial_update_annotations_file", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "file_id", - "id", - "x_organization", - "org", - "org_id", - "body", - ], - "required": [ - "file_id", - "id", - ], - "nullable": [], - "enum": [], - "validation": [ - "file_id", - ], - }, - root_map={ - "validations": { - ("file_id",): { - "regex": { - "pattern": r"^\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b$", # noqa: E501 - }, - }, - }, - "allowed_values": {}, - "openapi_types": { - "file_id": (str,), - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "body": (file_type,), - }, - "attribute_map": { - "file_id": "file_id", - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "file_id": "path", - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "body": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.retrieve_endpoint = _Endpoint( - settings={ - "response_schema": (JobRead,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/jobs/{id}", - "operation_id": "retrieve", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.retrieve_annotations_endpoint = _Endpoint( - settings={ - "response_schema": (LabeledData,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/jobs/{id}/annotations/", - "operation_id": "retrieve_annotations", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "action", - "cloud_storage_id", - "filename", - "format", - "location", - "org", - "org_id", - "use_default_location", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [ - "action", - "location", - ], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": { - ("action",): {"DOWNLOAD": "download"}, - ("location",): {"CLOUD_STORAGE": "cloud_storage", "LOCAL": "local"}, - }, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "action": (str,), - "cloud_storage_id": (float,), - "filename": (str,), - "format": (str,), - "location": (str,), - "org": (str,), - "org_id": (int,), - "use_default_location": (bool,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "action": "action", - "cloud_storage_id": "cloud_storage_id", - "filename": "filename", - "format": "format", - "location": "location", - "org": "org", - "org_id": "org_id", - "use_default_location": "use_default_location", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "action": "query", - "cloud_storage_id": "query", - "filename": "query", - "format": "query", - "location": "query", - "org": "query", - "org_id": "query", - "use_default_location": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.retrieve_data_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/jobs/{id}/data", - "operation_id": "retrieve_data", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "number", - "quality", - "type", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - "number", - "quality", - "type", - ], - "nullable": [], - "enum": [ - "quality", - "type", - ], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": { - ("quality",): {"COMPRESSED": "compressed", "ORIGINAL": "original"}, - ("type",): { - "CHUNK": "chunk", - "CONTEXT_IMAGE": "context_image", - "FRAME": "frame", - "PREVIEW": "preview", - }, - }, - "openapi_types": { - "id": (int,), - "number": (float,), - "quality": (str,), - "type": (str,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "number": "number", - "quality": "quality", - "type": "type", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "number": "query", - "quality": "query", - "type": "query", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.retrieve_data_meta_endpoint = _Endpoint( - settings={ - "response_schema": (DataMetaRead,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/jobs/{id}/data/meta", - "operation_id": "retrieve_data_meta", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.retrieve_dataset_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/jobs/{id}/dataset", - "operation_id": "retrieve_dataset", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "format", - "id", - "x_organization", - "action", - "cloud_storage_id", - "filename", - "location", - "org", - "org_id", - "use_default_location", - ], - "required": [ - "format", - "id", - ], - "nullable": [], - "enum": [ - "action", - "location", - ], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": { - ("action",): {"DOWNLOAD": "download"}, - ("location",): {"CLOUD_STORAGE": "cloud_storage", "LOCAL": "local"}, - }, - "openapi_types": { - "format": (str,), - "id": (int,), - "x_organization": (str,), - "action": (str,), - "cloud_storage_id": (float,), - "filename": (str,), - "location": (str,), - "org": (str,), - "org_id": (int,), - "use_default_location": (bool,), - }, - "attribute_map": { - "format": "format", - "id": "id", - "x_organization": "X-Organization", - "action": "action", - "cloud_storage_id": "cloud_storage_id", - "filename": "filename", - "location": "location", - "org": "org", - "org_id": "org_id", - "use_default_location": "use_default_location", - }, - "location_map": { - "format": "query", - "id": "path", - "x_organization": "header", - "action": "query", - "cloud_storage_id": "query", - "filename": "query", - "location": "query", - "org": "query", - "org_id": "query", - "use_default_location": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.update_endpoint = _Endpoint( - settings={ - "response_schema": (JobWrite,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/jobs/{id}", - "operation_id": "update", - "http_method": "PUT", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - "job_write_request", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "job_write_request": (JobWriteRequest,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "job_write_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.update_annotations_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/jobs/{id}/annotations/", - "operation_id": "update_annotations", - "http_method": "PUT", - "servers": None, - }, - params_map={ - "all": [ - "id", - "annotation_file_request", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - "annotation_file_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "annotation_file_request": (AnnotationFileRequest,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "annotation_file_request": "body", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - - def create_annotations( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method allows to upload job annotations # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create_annotations(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this job. - - Keyword Args: - x_organization (str): [optional] - cloud_storage_id (float): Storage id. [optional] - filename (str): Annotation file name. [optional] - format (str): Input format name You can get the list of supported formats at: /server/annotation/formats. [optional] - location (str): where to import the annotation from. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - use_default_location (bool): Use the location that was configured in the task to import annotation. [optional] if omitted the server will use the default value of True - job_write_request (JobWriteRequest): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.create_annotations_endpoint.call_with_http_info(**kwargs) - - def destroy_annotations( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method deletes all annotations for a specific job # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.destroy_annotations(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this job. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.destroy_annotations_endpoint.call_with_http_info(**kwargs) - - def list( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[PaginatedJobReadList], urllib3.HTTPResponse]: - """Method returns a paginated list of jobs according to query parameters # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.list(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - filter (str): A filter term. Avaliable filter_fields: ['task_name', 'project_name', 'assignee', 'state', 'stage', 'id', 'task_id', 'project_id', 'updated_date']. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - page (int): A page number within the paginated result set.. [optional] - page_size (int): Number of results to return per page.. [optional] - search (str): A search term. Avaliable search_fields: ('task_name', 'project_name', 'assignee', 'state', 'stage'). [optional] - sort (str): Which field to use when ordering the results. Avaliable ordering_fields: ['task_name', 'project_name', 'assignee', 'state', 'stage', 'id', 'task_id', 'project_id', 'updated_date']. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (PaginatedJobReadList, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.list_endpoint.call_with_http_info(**kwargs) - - def list_commits( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[PaginatedJobCommitList], urllib3.HTTPResponse]: - """The action returns the list of tracked changes for the job # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.list_commits(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this job. - - Keyword Args: - x_organization (str): [optional] - filter (str): A filter term. Avaliable filter_fields: ['task_name', 'project_name', 'assignee', 'state', 'stage', 'id', 'task_id', 'project_id', 'updated_date']. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - page (int): A page number within the paginated result set.. [optional] - page_size (int): Number of results to return per page.. [optional] - search (str): A search term. Avaliable search_fields: ('task_name', 'project_name', 'assignee', 'state', 'stage'). [optional] - sort (str): Which field to use when ordering the results. Avaliable ordering_fields: ['task_name', 'project_name', 'assignee', 'state', 'stage', 'id', 'task_id', 'project_id', 'updated_date']. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (PaginatedJobCommitList, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.list_commits_endpoint.call_with_http_info(**kwargs) - - def list_issues( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[PaginatedIssueReadList], urllib3.HTTPResponse]: - """Method returns list of issues for the job # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.list_issues(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this job. - - Keyword Args: - x_organization (str): [optional] - filter (str): A filter term. Avaliable filter_fields: ['task_name', 'project_name', 'assignee', 'state', 'stage', 'id', 'task_id', 'project_id', 'updated_date']. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - page (int): A page number within the paginated result set.. [optional] - page_size (int): Number of results to return per page.. [optional] - search (str): A search term. Avaliable search_fields: ('task_name', 'project_name', 'assignee', 'state', 'stage'). [optional] - sort (str): Which field to use when ordering the results. Avaliable ordering_fields: ['task_name', 'project_name', 'assignee', 'state', 'stage', 'id', 'task_id', 'project_id', 'updated_date']. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (PaginatedIssueReadList, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.list_issues_endpoint.call_with_http_info(**kwargs) - - def partial_update( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[JobWrite], urllib3.HTTPResponse]: - """Methods does a partial update of chosen fields in a job # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.partial_update(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this job. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - patched_job_write_request (PatchedJobWriteRequest): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (JobWrite, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.partial_update_endpoint.call_with_http_info(**kwargs) - - def partial_update_annotations( - self, - action: str, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method performs a partial update of annotations in a specific job # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.partial_update_annotations(action, id, _async_call=True) - >>> result = thread.get() - - Args: - action (str): - id (int): A unique integer value identifying this job. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - patched_job_write_request (PatchedJobWriteRequest): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["action"] = action - kwargs["id"] = id - return self.partial_update_annotations_endpoint.call_with_http_info(**kwargs) - - def partial_update_annotations_file( - self, - file_id: str, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Allows to upload an annotation file chunk. Implements TUS file uploading protocol. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.partial_update_annotations_file(file_id, id, _async_call=True) - >>> result = thread.get() - - Args: - file_id (str): - id (int): A unique integer value identifying this job. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - body (file_type): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["file_id"] = file_id - kwargs["id"] = id - return self.partial_update_annotations_file_endpoint.call_with_http_info(**kwargs) - - def retrieve( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[JobRead], urllib3.HTTPResponse]: - """Method returns details of a job # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this job. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (JobRead, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.retrieve_endpoint.call_with_http_info(**kwargs) - - def retrieve_annotations( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[LabeledData], urllib3.HTTPResponse]: - """Method returns annotations for a specific job # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_annotations(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this job. - - Keyword Args: - x_organization (str): [optional] - action (str): Used to start downloading process after annotation file had been created. [optional] if omitted the server will use the default value of "download" - cloud_storage_id (float): Storage id. [optional] - filename (str): Desired output file name. [optional] - format (str): Desired output format name You can get the list of supported formats at: /server/annotation/formats. [optional] - location (str): Where need to save downloaded annotation. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - use_default_location (bool): Use the location that was configured in the task to export annotation. [optional] if omitted the server will use the default value of True - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (LabeledData, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.retrieve_annotations_endpoint.call_with_http_info(**kwargs) - - def retrieve_data( - self, - id: int, - number: float, - quality: str, - type: str, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method returns data for a specific job # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_data(id, number, quality, type, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this job. - number (float): A unique number value identifying chunk or frame, doesn't matter for 'preview' type - quality (str): Specifies the quality level of the requested data, doesn't matter for 'preview' type - type (str): Specifies the type of the requested data - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - kwargs["number"] = number - kwargs["quality"] = quality - kwargs["type"] = type - return self.retrieve_data_endpoint.call_with_http_info(**kwargs) - - def retrieve_data_meta( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[DataMetaRead], urllib3.HTTPResponse]: - """Method provides a meta information about media files which are related with the job # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_data_meta(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this job. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (DataMetaRead, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.retrieve_data_meta_endpoint.call_with_http_info(**kwargs) - - def retrieve_dataset( - self, - format: str, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Export job as a dataset in a specific format # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_dataset(format, id, _async_call=True) - >>> result = thread.get() - - Args: - format (str): Desired output format name You can get the list of supported formats at: /server/annotation/formats - id (int): A unique integer value identifying this job. - - Keyword Args: - x_organization (str): [optional] - action (str): Used to start downloading process after annotation file had been created. [optional] if omitted the server will use the default value of "download" - cloud_storage_id (float): Storage id. [optional] - filename (str): Desired output file name. [optional] - location (str): Where need to save downloaded dataset. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - use_default_location (bool): Use the location that was configured in the task to export dataset. [optional] if omitted the server will use the default value of True - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["format"] = format - kwargs["id"] = id - return self.retrieve_dataset_endpoint.call_with_http_info(**kwargs) - - def update( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[JobWrite], urllib3.HTTPResponse]: - """Method updates a job by id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.update(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this job. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - job_write_request (JobWriteRequest): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (JobWrite, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.update_endpoint.call_with_http_info(**kwargs) - - def update_annotations( - self, - id: int, - annotation_file_request: AnnotationFileRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method performs an update of all annotations in a specific job # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.update_annotations(id, annotation_file_request, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this job. - annotation_file_request (AnnotationFileRequest): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - kwargs["annotation_file_request"] = annotation_file_request - return self.update_annotations_endpoint.call_with_http_info(**kwargs) diff --git a/cvat-sdk/cvat_sdk/api/lambda_api.py b/cvat-sdk/cvat_sdk/api/lambda_api.py deleted file mode 100644 index 76b689c3..00000000 --- a/cvat-sdk/cvat_sdk/api/lambda_api.py +++ /dev/null @@ -1,830 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import typing -from typing import TYPE_CHECKING - -import urllib3 - -from cvat_sdk.api_client import ApiClient -from cvat_sdk.api_client import Endpoint as _Endpoint -from cvat_sdk.model_utils import date, datetime, file_type, none_type # noqa: F401 - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class LambdaApi(object): - """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): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.create_functions_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/lambda/functions/{func_id}", - "operation_id": "create_functions", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "func_id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "func_id", - ], - "nullable": [], - "enum": [], - "validation": [ - "func_id", - ], - }, - root_map={ - "validations": { - ("func_id",): { - "regex": { - "pattern": r"^[a-zA-Z0-9_.-]+$", # noqa: E501 - }, - }, - }, - "allowed_values": {}, - "openapi_types": { - "func_id": (str,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "func_id": "func_id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "func_id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.create_requests_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/lambda/requests", - "operation_id": "create_requests", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "org", - "org_id", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.list_functions_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/lambda/functions", - "operation_id": "list_functions", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "org", - "org_id", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.list_requests_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/lambda/requests", - "operation_id": "list_requests", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "org", - "org_id", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.retrieve_functions_endpoint = _Endpoint( - settings={ - "response_schema": ( - {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, - ), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/lambda/functions/{func_id}", - "operation_id": "retrieve_functions", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "func_id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "func_id", - ], - "nullable": [], - "enum": [], - "validation": [ - "func_id", - ], - }, - root_map={ - "validations": { - ("func_id",): { - "regex": { - "pattern": r"^[a-zA-Z0-9_.-]+$", # noqa: E501 - }, - }, - }, - "allowed_values": {}, - "openapi_types": { - "func_id": (str,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "func_id": "func_id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "func_id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.retrieve_requests_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/lambda/requests/{id}", - "operation_id": "retrieve_requests", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - - def create_functions( - self, - func_id: str, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """create_functions # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create_functions(func_id, _async_call=True) - >>> result = thread.get() - - Args: - func_id (str): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["func_id"] = func_id - return self.create_functions_endpoint.call_with_http_info(**kwargs) - - def create_requests( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method calls the function # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create_requests(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.create_requests_endpoint.call_with_http_info(**kwargs) - - def list_functions( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method returns a list of functions # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.list_functions(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.list_functions_endpoint.call_with_http_info(**kwargs) - - def list_requests( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method returns a list of requests # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.list_requests(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.list_requests_endpoint.call_with_http_info(**kwargs) - - def retrieve_functions( - self, - func_id: str, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[ - typing.Optional[typing.Dict[str, typing.Union[typing.Any, none_type]]], urllib3.HTTPResponse - ]: - """Method returns the information about the function # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_functions(func_id, _async_call=True) - >>> result = thread.get() - - Args: - func_id (str): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["func_id"] = func_id - return self.retrieve_functions_endpoint.call_with_http_info(**kwargs) - - def retrieve_requests( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method returns the status of the request # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_requests(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): Request id - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.retrieve_requests_endpoint.call_with_http_info(**kwargs) diff --git a/cvat-sdk/cvat_sdk/api/memberships_api.py b/cvat-sdk/cvat_sdk/api/memberships_api.py deleted file mode 100644 index a5a66f90..00000000 --- a/cvat-sdk/cvat_sdk/api/memberships_api.py +++ /dev/null @@ -1,602 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import typing -from typing import TYPE_CHECKING - -import urllib3 - -from cvat_sdk.api_client import ApiClient -from cvat_sdk.api_client import Endpoint as _Endpoint -from cvat_sdk.model.membership_read import MembershipRead -from cvat_sdk.model.membership_write import MembershipWrite -from cvat_sdk.model.paginated_membership_read_list import PaginatedMembershipReadList -from cvat_sdk.model.patched_membership_write_request import PatchedMembershipWriteRequest -from cvat_sdk.model_utils import date, datetime, file_type, none_type # noqa: F401 - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class MembershipsApi(object): - """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): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.destroy_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/memberships/{id}", - "operation_id": "destroy", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.list_endpoint = _Endpoint( - settings={ - "response_schema": (PaginatedMembershipReadList,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/memberships", - "operation_id": "list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "filter", - "org", - "org_id", - "page", - "page_size", - "search", - "sort", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "filter": (str,), - "org": (str,), - "org_id": (int,), - "page": (int,), - "page_size": (int,), - "search": (str,), - "sort": (str,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "filter": "filter", - "org": "org", - "org_id": "org_id", - "page": "page", - "page_size": "page_size", - "search": "search", - "sort": "sort", - }, - "location_map": { - "x_organization": "header", - "filter": "query", - "org": "query", - "org_id": "query", - "page": "query", - "page_size": "query", - "search": "query", - "sort": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.partial_update_endpoint = _Endpoint( - settings={ - "response_schema": (MembershipWrite,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/memberships/{id}", - "operation_id": "partial_update", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - "patched_membership_write_request", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "patched_membership_write_request": (PatchedMembershipWriteRequest,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "patched_membership_write_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.retrieve_endpoint = _Endpoint( - settings={ - "response_schema": (MembershipRead,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/memberships/{id}", - "operation_id": "retrieve", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - - def destroy( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method deletes a membership # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.destroy(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this membership. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.destroy_endpoint.call_with_http_info(**kwargs) - - def list( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[PaginatedMembershipReadList], urllib3.HTTPResponse]: - """Method returns a paginated list of memberships according to query parameters # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.list(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - filter (str): A filter term. Avaliable filter_fields: ['user_name', 'role', 'id', 'user']. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - page (int): A page number within the paginated result set.. [optional] - page_size (int): Number of results to return per page.. [optional] - search (str): A search term. Avaliable search_fields: ('user_name', 'role'). [optional] - sort (str): Which field to use when ordering the results. Avaliable ordering_fields: ['user_name', 'role', 'id', 'user']. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (PaginatedMembershipReadList, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.list_endpoint.call_with_http_info(**kwargs) - - def partial_update( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[MembershipWrite], urllib3.HTTPResponse]: - """Methods does a partial update of chosen fields in a membership # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.partial_update(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this membership. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - patched_membership_write_request (PatchedMembershipWriteRequest): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (MembershipWrite, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.partial_update_endpoint.call_with_http_info(**kwargs) - - def retrieve( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[MembershipRead], urllib3.HTTPResponse]: - """Method returns details of a membership # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this membership. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (MembershipRead, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.retrieve_endpoint.call_with_http_info(**kwargs) diff --git a/cvat-sdk/cvat_sdk/api/organizations_api.py b/cvat-sdk/cvat_sdk/api/organizations_api.py deleted file mode 100644 index 2128a0f3..00000000 --- a/cvat-sdk/cvat_sdk/api/organizations_api.py +++ /dev/null @@ -1,729 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import typing -from typing import TYPE_CHECKING - -import urllib3 - -from cvat_sdk.api_client import ApiClient -from cvat_sdk.api_client import Endpoint as _Endpoint -from cvat_sdk.model.organization_read import OrganizationRead -from cvat_sdk.model.organization_write import OrganizationWrite -from cvat_sdk.model.organization_write_request import OrganizationWriteRequest -from cvat_sdk.model.patched_organization_write_request import PatchedOrganizationWriteRequest -from cvat_sdk.model_utils import date, datetime, file_type, none_type # noqa: F401 - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class OrganizationsApi(object): - """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): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.create_endpoint = _Endpoint( - settings={ - "response_schema": (OrganizationWrite,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/organizations", - "operation_id": "create", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "organization_write_request", - "x_organization", - "org", - "org_id", - ], - "required": [ - "organization_write_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "organization_write_request": (OrganizationWriteRequest,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "organization_write_request": "body", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.destroy_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/organizations/{id}", - "operation_id": "destroy", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.list_endpoint = _Endpoint( - settings={ - "response_schema": ([OrganizationRead],), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/organizations", - "operation_id": "list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "filter", - "org", - "org_id", - "search", - "sort", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "filter": (str,), - "org": (str,), - "org_id": (int,), - "search": (str,), - "sort": (str,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "filter": "filter", - "org": "org", - "org_id": "org_id", - "search": "search", - "sort": "sort", - }, - "location_map": { - "x_organization": "header", - "filter": "query", - "org": "query", - "org_id": "query", - "search": "query", - "sort": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.partial_update_endpoint = _Endpoint( - settings={ - "response_schema": (OrganizationWrite,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/organizations/{id}", - "operation_id": "partial_update", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - "patched_organization_write_request", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "patched_organization_write_request": (PatchedOrganizationWriteRequest,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "patched_organization_write_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.retrieve_endpoint = _Endpoint( - settings={ - "response_schema": (OrganizationRead,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/organizations/{id}", - "operation_id": "retrieve", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - - def create( - self, - organization_write_request: OrganizationWriteRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[OrganizationWrite], urllib3.HTTPResponse]: - """Method creates an organization # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create(organization_write_request, _async_call=True) - >>> result = thread.get() - - Args: - organization_write_request (OrganizationWriteRequest): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (OrganizationWrite, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["organization_write_request"] = organization_write_request - return self.create_endpoint.call_with_http_info(**kwargs) - - def destroy( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method deletes an organization # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.destroy(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this organization. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.destroy_endpoint.call_with_http_info(**kwargs) - - def list( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[typing.List[OrganizationRead]], urllib3.HTTPResponse]: - """Method returns a paginated list of organizatins according to query parameters # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.list(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - filter (str): A filter term. Avaliable filter_fields: ['name', 'owner', 'id', 'slug']. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - search (str): A search term. Avaliable search_fields: ('name', 'owner'). [optional] - sort (str): Which field to use when ordering the results. Avaliable ordering_fields: ['name', 'owner', 'id', 'slug']. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - ([OrganizationRead], HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.list_endpoint.call_with_http_info(**kwargs) - - def partial_update( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[OrganizationWrite], urllib3.HTTPResponse]: - """Methods does a partial update of chosen fields in an organization # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.partial_update(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this organization. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - patched_organization_write_request (PatchedOrganizationWriteRequest): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (OrganizationWrite, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.partial_update_endpoint.call_with_http_info(**kwargs) - - def retrieve( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[OrganizationRead], urllib3.HTTPResponse]: - """Method returns details of an organization # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this organization. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (OrganizationRead, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.retrieve_endpoint.call_with_http_info(**kwargs) diff --git a/cvat-sdk/cvat_sdk/api/projects_api.py b/cvat-sdk/cvat_sdk/api/projects_api.py deleted file mode 100644 index 3ac29b9c..00000000 --- a/cvat-sdk/cvat_sdk/api/projects_api.py +++ /dev/null @@ -1,2044 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import typing -from typing import TYPE_CHECKING - -import urllib3 - -from cvat_sdk.api_client import ApiClient -from cvat_sdk.api_client import Endpoint as _Endpoint -from cvat_sdk.model.dataset_file_request import DatasetFileRequest -from cvat_sdk.model.paginated_polymorphic_project_list import PaginatedPolymorphicProjectList -from cvat_sdk.model.paginated_task_read_list import PaginatedTaskReadList -from cvat_sdk.model.patched_project_write_request import PatchedProjectWriteRequest -from cvat_sdk.model.project_file_request import ProjectFileRequest -from cvat_sdk.model.project_read import ProjectRead -from cvat_sdk.model.project_write import ProjectWrite -from cvat_sdk.model.project_write_request import ProjectWriteRequest -from cvat_sdk.model_utils import date, datetime, file_type, none_type # noqa: F401 - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class ProjectsApi(object): - """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): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.create_endpoint = _Endpoint( - settings={ - "response_schema": (ProjectWrite,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/projects", - "operation_id": "create", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "project_write_request", - "x_organization", - "org", - "org_id", - ], - "required": [ - "project_write_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "project_write_request": (ProjectWriteRequest,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "project_write_request": "body", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.create_backup_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/projects/backup/", - "operation_id": "create_backup", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "project_file_request", - "x_organization", - "cloud_storage_id", - "filename", - "location", - "org", - "org_id", - ], - "required": [ - "project_file_request", - ], - "nullable": [], - "enum": [ - "location", - ], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": { - ("location",): {"CLOUD_STORAGE": "cloud_storage", "LOCAL": "local"}, - }, - "openapi_types": { - "project_file_request": (ProjectFileRequest,), - "x_organization": (str,), - "cloud_storage_id": (float,), - "filename": (str,), - "location": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "cloud_storage_id": "cloud_storage_id", - "filename": "filename", - "location": "location", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "project_file_request": "body", - "x_organization": "header", - "cloud_storage_id": "query", - "filename": "query", - "location": "query", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.create_dataset_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/projects/{id}/dataset/", - "operation_id": "create_dataset", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "id", - "dataset_file_request", - "x_organization", - "cloud_storage_id", - "filename", - "format", - "location", - "org", - "org_id", - "use_default_location", - ], - "required": [ - "id", - "dataset_file_request", - ], - "nullable": [], - "enum": [ - "location", - ], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": { - ("location",): {"CLOUD_STORAGE": "cloud_storage", "LOCAL": "local"}, - }, - "openapi_types": { - "id": (int,), - "dataset_file_request": (DatasetFileRequest,), - "x_organization": (str,), - "cloud_storage_id": (float,), - "filename": (str,), - "format": (str,), - "location": (str,), - "org": (str,), - "org_id": (int,), - "use_default_location": (bool,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "cloud_storage_id": "cloud_storage_id", - "filename": "filename", - "format": "format", - "location": "location", - "org": "org", - "org_id": "org_id", - "use_default_location": "use_default_location", - }, - "location_map": { - "id": "path", - "dataset_file_request": "body", - "x_organization": "header", - "cloud_storage_id": "query", - "filename": "query", - "format": "query", - "location": "query", - "org": "query", - "org_id": "query", - "use_default_location": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.destroy_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/projects/{id}", - "operation_id": "destroy", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.list_endpoint = _Endpoint( - settings={ - "response_schema": (PaginatedPolymorphicProjectList,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/projects", - "operation_id": "list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "filter", - "org", - "org_id", - "page", - "page_size", - "search", - "sort", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "filter": (str,), - "org": (str,), - "org_id": (int,), - "page": (int,), - "page_size": (int,), - "search": (str,), - "sort": (str,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "filter": "filter", - "org": "org", - "org_id": "org_id", - "page": "page", - "page_size": "page_size", - "search": "search", - "sort": "sort", - }, - "location_map": { - "x_organization": "header", - "filter": "query", - "org": "query", - "org_id": "query", - "page": "query", - "page_size": "query", - "search": "query", - "sort": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.list_tasks_endpoint = _Endpoint( - settings={ - "response_schema": (PaginatedTaskReadList,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/projects/{id}/tasks", - "operation_id": "list_tasks", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "filter", - "org", - "org_id", - "page", - "page_size", - "search", - "sort", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "filter": (str,), - "org": (str,), - "org_id": (int,), - "page": (int,), - "page_size": (int,), - "search": (str,), - "sort": (str,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "filter": "filter", - "org": "org", - "org_id": "org_id", - "page": "page", - "page_size": "page_size", - "search": "search", - "sort": "sort", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "filter": "query", - "org": "query", - "org_id": "query", - "page": "query", - "page_size": "query", - "search": "query", - "sort": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.partial_update_endpoint = _Endpoint( - settings={ - "response_schema": (ProjectWrite,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/projects/{id}", - "operation_id": "partial_update", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - "patched_project_write_request", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "patched_project_write_request": (PatchedProjectWriteRequest,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "patched_project_write_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.partial_update_backup_file_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/projects/backup/{file_id}", - "operation_id": "partial_update_backup_file", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "file_id", - "x_organization", - "org", - "org_id", - "body", - ], - "required": [ - "file_id", - ], - "nullable": [], - "enum": [], - "validation": [ - "file_id", - ], - }, - root_map={ - "validations": { - ("file_id",): { - "regex": { - "pattern": r"^\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b$", # noqa: E501 - }, - }, - }, - "allowed_values": {}, - "openapi_types": { - "file_id": (str,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "body": (file_type,), - }, - "attribute_map": { - "file_id": "file_id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "file_id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "body": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.partial_update_dataset_file_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/projects/{id}/dataset/{file_id}", - "operation_id": "partial_update_dataset_file", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "file_id", - "id", - "x_organization", - "org", - "org_id", - "body", - ], - "required": [ - "file_id", - "id", - ], - "nullable": [], - "enum": [], - "validation": [ - "file_id", - ], - }, - root_map={ - "validations": { - ("file_id",): { - "regex": { - "pattern": r"^\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b$", # noqa: E501 - }, - }, - }, - "allowed_values": {}, - "openapi_types": { - "file_id": (str,), - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "body": (file_type,), - }, - "attribute_map": { - "file_id": "file_id", - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "file_id": "path", - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "body": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.retrieve_endpoint = _Endpoint( - settings={ - "response_schema": (ProjectRead,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/projects/{id}", - "operation_id": "retrieve", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.retrieve_annotations_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/projects/{id}/annotations", - "operation_id": "retrieve_annotations", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "format", - "id", - "x_organization", - "action", - "cloud_storage_id", - "filename", - "location", - "org", - "org_id", - "use_default_location", - ], - "required": [ - "format", - "id", - ], - "nullable": [], - "enum": [ - "action", - "location", - ], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": { - ("action",): {"DOWNLOAD": "download"}, - ("location",): {"CLOUD_STORAGE": "cloud_storage", "LOCAL": "local"}, - }, - "openapi_types": { - "format": (str,), - "id": (int,), - "x_organization": (str,), - "action": (str,), - "cloud_storage_id": (float,), - "filename": (str,), - "location": (str,), - "org": (str,), - "org_id": (int,), - "use_default_location": (bool,), - }, - "attribute_map": { - "format": "format", - "id": "id", - "x_organization": "X-Organization", - "action": "action", - "cloud_storage_id": "cloud_storage_id", - "filename": "filename", - "location": "location", - "org": "org", - "org_id": "org_id", - "use_default_location": "use_default_location", - }, - "location_map": { - "format": "query", - "id": "path", - "x_organization": "header", - "action": "query", - "cloud_storage_id": "query", - "filename": "query", - "location": "query", - "org": "query", - "org_id": "query", - "use_default_location": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.retrieve_backup_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/projects/{id}/backup", - "operation_id": "retrieve_backup", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "action", - "cloud_storage_id", - "filename", - "location", - "org", - "org_id", - "use_default_location", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [ - "action", - "location", - ], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": { - ("action",): {"DOWNLOAD": "download"}, - ("location",): {"CLOUD_STORAGE": "cloud_storage", "LOCAL": "local"}, - }, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "action": (str,), - "cloud_storage_id": (float,), - "filename": (str,), - "location": (str,), - "org": (str,), - "org_id": (int,), - "use_default_location": (bool,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "action": "action", - "cloud_storage_id": "cloud_storage_id", - "filename": "filename", - "location": "location", - "org": "org", - "org_id": "org_id", - "use_default_location": "use_default_location", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "action": "query", - "cloud_storage_id": "query", - "filename": "query", - "location": "query", - "org": "query", - "org_id": "query", - "use_default_location": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.retrieve_dataset_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/projects/{id}/dataset/", - "operation_id": "retrieve_dataset", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "action", - "cloud_storage_id", - "filename", - "format", - "location", - "org", - "org_id", - "use_default_location", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [ - "action", - "location", - ], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": { - ("action",): {"DOWNLOAD": "download", "IMPORT_STATUS": "import_status"}, - ("location",): {"CLOUD_STORAGE": "cloud_storage", "LOCAL": "local"}, - }, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "action": (str,), - "cloud_storage_id": (float,), - "filename": (str,), - "format": (str,), - "location": (str,), - "org": (str,), - "org_id": (int,), - "use_default_location": (bool,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "action": "action", - "cloud_storage_id": "cloud_storage_id", - "filename": "filename", - "format": "format", - "location": "location", - "org": "org", - "org_id": "org_id", - "use_default_location": "use_default_location", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "action": "query", - "cloud_storage_id": "query", - "filename": "query", - "format": "query", - "location": "query", - "org": "query", - "org_id": "query", - "use_default_location": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - - def create( - self, - project_write_request: ProjectWriteRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[ProjectWrite], urllib3.HTTPResponse]: - """Method creates a new project # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create(project_write_request, _async_call=True) - >>> result = thread.get() - - Args: - project_write_request (ProjectWriteRequest): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (ProjectWrite, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["project_write_request"] = project_write_request - return self.create_endpoint.call_with_http_info(**kwargs) - - def create_backup( - self, - project_file_request: ProjectFileRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Methods create a project from a backup # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create_backup(project_file_request, _async_call=True) - >>> result = thread.get() - - Args: - project_file_request (ProjectFileRequest): - - Keyword Args: - x_organization (str): [optional] - cloud_storage_id (float): Storage id. [optional] - filename (str): Backup file name. [optional] - location (str): Where to import the backup file from. [optional] if omitted the server will use the default value of "local" - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["project_file_request"] = project_file_request - return self.create_backup_endpoint.call_with_http_info(**kwargs) - - def create_dataset( - self, - id: int, - dataset_file_request: DatasetFileRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Import dataset in specific format as a project # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create_dataset(id, dataset_file_request, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this project. - dataset_file_request (DatasetFileRequest): - - Keyword Args: - x_organization (str): [optional] - cloud_storage_id (float): Storage id. [optional] - filename (str): Dataset file name. [optional] - format (str): Desired dataset format name You can get the list of supported formats at: /server/annotation/formats. [optional] - location (str): Where to import the dataset from. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - use_default_location (bool): Use the location that was configured in the project to import annotations. [optional] if omitted the server will use the default value of True - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - kwargs["dataset_file_request"] = dataset_file_request - return self.create_dataset_endpoint.call_with_http_info(**kwargs) - - def destroy( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method deletes a specific project # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.destroy(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this project. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.destroy_endpoint.call_with_http_info(**kwargs) - - def list( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[PaginatedPolymorphicProjectList], urllib3.HTTPResponse]: - """Returns a paginated list of projects according to query parameters (12 projects per page) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.list(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - filter (str): A filter term. Avaliable filter_fields: ['name', 'owner', 'assignee', 'status', 'id', 'updated_date']. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - page (int): A page number within the paginated result set.. [optional] - page_size (int): Number of results to return per page.. [optional] - search (str): A search term. Avaliable search_fields: ('name', 'owner', 'assignee', 'status'). [optional] - sort (str): Which field to use when ordering the results. Avaliable ordering_fields: ['name', 'owner', 'assignee', 'status', 'id', 'updated_date']. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (PaginatedPolymorphicProjectList, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.list_endpoint.call_with_http_info(**kwargs) - - def list_tasks( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[PaginatedTaskReadList], urllib3.HTTPResponse]: - """Method returns information of the tasks of the project with the selected id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.list_tasks(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this project. - - Keyword Args: - x_organization (str): [optional] - filter (str): A filter term. Avaliable filter_fields: ['name', 'owner', 'assignee', 'status', 'id', 'updated_date']. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - page (int): A page number within the paginated result set.. [optional] - page_size (int): Number of results to return per page.. [optional] - search (str): A search term. Avaliable search_fields: ('name', 'owner', 'assignee', 'status'). [optional] - sort (str): Which field to use when ordering the results. Avaliable ordering_fields: ['name', 'owner', 'assignee', 'status', 'id', 'updated_date']. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (PaginatedTaskReadList, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.list_tasks_endpoint.call_with_http_info(**kwargs) - - def partial_update( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[ProjectWrite], urllib3.HTTPResponse]: - """Methods does a partial update of chosen fields in a project # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.partial_update(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this project. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - patched_project_write_request (PatchedProjectWriteRequest): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (ProjectWrite, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.partial_update_endpoint.call_with_http_info(**kwargs) - - def partial_update_backup_file( - self, - file_id: str, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Allows to upload a file chunk. Implements TUS file uploading protocol. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.partial_update_backup_file(file_id, _async_call=True) - >>> result = thread.get() - - Args: - file_id (str): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - body (file_type): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["file_id"] = file_id - return self.partial_update_backup_file_endpoint.call_with_http_info(**kwargs) - - def partial_update_dataset_file( - self, - file_id: str, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Allows to upload a file chunk. Implements TUS file uploading protocol. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.partial_update_dataset_file(file_id, id, _async_call=True) - >>> result = thread.get() - - Args: - file_id (str): - id (int): A unique integer value identifying this project. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - body (file_type): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["file_id"] = file_id - kwargs["id"] = id - return self.partial_update_dataset_file_endpoint.call_with_http_info(**kwargs) - - def retrieve( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[ProjectRead], urllib3.HTTPResponse]: - """Method returns details of a specific project # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this project. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (ProjectRead, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.retrieve_endpoint.call_with_http_info(**kwargs) - - def retrieve_annotations( - self, - format: str, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method allows to download project annotations # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_annotations(format, id, _async_call=True) - >>> result = thread.get() - - Args: - format (str): Desired output format name You can get the list of supported formats at: /server/annotation/formats - id (int): A unique integer value identifying this project. - - Keyword Args: - x_organization (str): [optional] - action (str): Used to start downloading process after annotation file had been created. [optional] if omitted the server will use the default value of "download" - cloud_storage_id (float): Storage id. [optional] - filename (str): Desired output file name. [optional] - location (str): Where need to save downloaded dataset. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - use_default_location (bool): Use the location that was configured in project to export annotation. [optional] if omitted the server will use the default value of True - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["format"] = format - kwargs["id"] = id - return self.retrieve_annotations_endpoint.call_with_http_info(**kwargs) - - def retrieve_backup( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Methods creates a backup copy of a project # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_backup(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this project. - - Keyword Args: - x_organization (str): [optional] - action (str): Used to start downloading process after backup file had been created. [optional] if omitted the server will use the default value of "download" - cloud_storage_id (float): Storage id. [optional] - filename (str): Backup file name. [optional] - location (str): Where need to save downloaded backup. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - use_default_location (bool): Use the location that was configured in project to export backup. [optional] if omitted the server will use the default value of True - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.retrieve_backup_endpoint.call_with_http_info(**kwargs) - - def retrieve_dataset( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Export project as a dataset in a specific format # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_dataset(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this project. - - Keyword Args: - x_organization (str): [optional] - action (str): Used to start downloading process after annotation file had been created. [optional] - cloud_storage_id (float): Storage id. [optional] - filename (str): Desired output file name. [optional] - format (str): Desired output format name You can get the list of supported formats at: /server/annotation/formats. [optional] - location (str): Where need to save downloaded dataset. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - use_default_location (bool): Use the location that was configured in project to import dataset. [optional] if omitted the server will use the default value of True - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.retrieve_dataset_endpoint.call_with_http_info(**kwargs) diff --git a/cvat-sdk/cvat_sdk/api/restrictions_api.py b/cvat-sdk/cvat_sdk/api/restrictions_api.py deleted file mode 100644 index 28220ed1..00000000 --- a/cvat-sdk/cvat_sdk/api/restrictions_api.py +++ /dev/null @@ -1,289 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import typing -from typing import TYPE_CHECKING - -import urllib3 - -from cvat_sdk.api_client import ApiClient -from cvat_sdk.api_client import Endpoint as _Endpoint -from cvat_sdk.model.user_agreement import UserAgreement -from cvat_sdk.model_utils import date, datetime, file_type, none_type # noqa: F401 - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class RestrictionsApi(object): - """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): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.retrieve_terms_of_use_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": [], - "endpoint_path": "/api/restrictions/terms-of-use", - "operation_id": "retrieve_terms_of_use", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "org", - "org_id", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.retrieve_user_agreements_endpoint = _Endpoint( - settings={ - "response_schema": (UserAgreement,), - "auth": [], - "endpoint_path": "/api/restrictions/user-agreements", - "operation_id": "retrieve_user_agreements", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "org", - "org_id", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - - def retrieve_terms_of_use( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method provides CVAT terms of use # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_terms_of_use(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.retrieve_terms_of_use_endpoint.call_with_http_info(**kwargs) - - def retrieve_user_agreements( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[UserAgreement], urllib3.HTTPResponse]: - """Method provides user agreements that the user must accept to register # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_user_agreements(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (UserAgreement, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.retrieve_user_agreements_endpoint.call_with_http_info(**kwargs) diff --git a/cvat-sdk/cvat_sdk/api/schema_api.py b/cvat-sdk/cvat_sdk/api/schema_api.py deleted file mode 100644 index 0fba3f75..00000000 --- a/cvat-sdk/cvat_sdk/api/schema_api.py +++ /dev/null @@ -1,288 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import typing -from typing import TYPE_CHECKING - -import urllib3 - -from cvat_sdk.api_client import ApiClient -from cvat_sdk.api_client import Endpoint as _Endpoint -from cvat_sdk.model_utils import date, datetime, file_type, none_type # noqa: F401 - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class SchemaApi(object): - """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): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.retrieve_endpoint = _Endpoint( - settings={ - "response_schema": ( - {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, - ), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/schema/", - "operation_id": "retrieve", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "lang", - "org", - "org_id", - "scheme", - ], - "required": [], - "nullable": [], - "enum": [ - "lang", - "scheme", - ], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": { - ("lang",): { - "AF": "af", - "AR": "ar", - "AR-DZ": "ar-dz", - "AST": "ast", - "AZ": "az", - "BE": "be", - "BG": "bg", - "BN": "bn", - "BR": "br", - "BS": "bs", - "CA": "ca", - "CS": "cs", - "CY": "cy", - "DA": "da", - "DE": "de", - "DSB": "dsb", - "EL": "el", - "EN": "en", - "EN-AU": "en-au", - "EN-GB": "en-gb", - "EO": "eo", - "ES": "es", - "ES-AR": "es-ar", - "ES-CO": "es-co", - "ES-MX": "es-mx", - "ES-NI": "es-ni", - "ES-VE": "es-ve", - "ET": "et", - "EU": "eu", - "FA": "fa", - "FI": "fi", - "FR": "fr", - "FY": "fy", - "GA": "ga", - "GD": "gd", - "GL": "gl", - "HE": "he", - "HI": "hi", - "HR": "hr", - "HSB": "hsb", - "HU": "hu", - "HY": "hy", - "IA": "ia", - "ID": "id", - "IG": "ig", - "IO": "io", - "IS": "is", - "IT": "it", - "JA": "ja", - "KA": "ka", - "KAB": "kab", - "KK": "kk", - "KM": "km", - "KN": "kn", - "KO": "ko", - "KY": "ky", - "LB": "lb", - "LT": "lt", - "LV": "lv", - "MK": "mk", - "ML": "ml", - "MN": "mn", - "MR": "mr", - "MY": "my", - "NB": "nb", - "NE": "ne", - "NL": "nl", - "NN": "nn", - "OS": "os", - "PA": "pa", - "PL": "pl", - "PT": "pt", - "PT-BR": "pt-br", - "RO": "ro", - "RU": "ru", - "SK": "sk", - "SL": "sl", - "SQ": "sq", - "SR": "sr", - "SR-LATN": "sr-latn", - "SV": "sv", - "SW": "sw", - "TA": "ta", - "TE": "te", - "TG": "tg", - "TH": "th", - "TK": "tk", - "TR": "tr", - "TT": "tt", - "UDM": "udm", - "UK": "uk", - "UR": "ur", - "UZ": "uz", - "VI": "vi", - "ZH-HANS": "zh-hans", - "ZH-HANT": "zh-hant", - }, - ("scheme",): {"JSON": "json", "YAML": "yaml"}, - }, - "openapi_types": { - "x_organization": (str,), - "lang": (str,), - "org": (str,), - "org_id": (int,), - "scheme": (str,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "lang": "lang", - "org": "org", - "org_id": "org_id", - "scheme": "scheme", - }, - "location_map": { - "x_organization": "header", - "lang": "query", - "org": "query", - "org_id": "query", - "scheme": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [ - "application/vnd.oai.openapi", - "application/yaml", - "application/vnd.oai.openapi+json", - "application/json", - ], - "content_type": [], - }, - api_client=api_client, - ) - - def retrieve( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[ - typing.Optional[typing.Dict[str, typing.Union[typing.Any, none_type]]], urllib3.HTTPResponse - ]: - """retrieve # noqa: E501 - - OpenApi3 schema for this API. Format can be selected via content negotiation. - YAML: application/vnd.oai.openapi - JSON: application/vnd.oai.openapi+json # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - lang (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - scheme (str): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.retrieve_endpoint.call_with_http_info(**kwargs) diff --git a/cvat-sdk/cvat_sdk/api/server_api.py b/cvat-sdk/cvat_sdk/api/server_api.py deleted file mode 100644 index 99a88753..00000000 --- a/cvat-sdk/cvat_sdk/api/server_api.py +++ /dev/null @@ -1,823 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import typing -from typing import TYPE_CHECKING - -import urllib3 - -from cvat_sdk.api_client import ApiClient -from cvat_sdk.api_client import Endpoint as _Endpoint -from cvat_sdk.model.about import About -from cvat_sdk.model.dataset_formats import DatasetFormats -from cvat_sdk.model.exception import Exception -from cvat_sdk.model.exception_request import ExceptionRequest -from cvat_sdk.model.file_info import FileInfo -from cvat_sdk.model.log_event import LogEvent -from cvat_sdk.model.log_event_request import LogEventRequest -from cvat_sdk.model.plugins import Plugins -from cvat_sdk.model_utils import date, datetime, file_type, none_type # noqa: F401 - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class ServerApi(object): - """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): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.create_exception_endpoint = _Endpoint( - settings={ - "response_schema": (Exception,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/server/exception", - "operation_id": "create_exception", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "exception_request", - "x_organization", - "org", - "org_id", - ], - "required": [ - "exception_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "exception_request": (ExceptionRequest,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "exception_request": "body", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.create_logs_endpoint = _Endpoint( - settings={ - "response_schema": ([LogEvent],), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/server/logs", - "operation_id": "create_logs", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "log_event_request", - "x_organization", - "org", - "org_id", - ], - "required": [ - "log_event_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "log_event_request": ([LogEventRequest],), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "log_event_request": "body", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.list_share_endpoint = _Endpoint( - settings={ - "response_schema": ([FileInfo],), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/server/share", - "operation_id": "list_share", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "directory", - "org", - "org_id", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "directory": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "directory": "directory", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "x_organization": "header", - "directory": "query", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.retrieve_about_endpoint = _Endpoint( - settings={ - "response_schema": (About,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/server/about", - "operation_id": "retrieve_about", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "org", - "org_id", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.retrieve_annotation_formats_endpoint = _Endpoint( - settings={ - "response_schema": (DatasetFormats,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/server/annotation/formats", - "operation_id": "retrieve_annotation_formats", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "org", - "org_id", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.retrieve_plugins_endpoint = _Endpoint( - settings={ - "response_schema": (Plugins,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/server/plugins", - "operation_id": "retrieve_plugins", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "org", - "org_id", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - - def create_exception( - self, - exception_request: ExceptionRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[Exception], urllib3.HTTPResponse]: - """Method saves an exception from a client on the server # noqa: E501 - - Sends logs to the ELK if it is connected # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create_exception(exception_request, _async_call=True) - >>> result = thread.get() - - Args: - exception_request (ExceptionRequest): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (Exception, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["exception_request"] = exception_request - return self.create_exception_endpoint.call_with_http_info(**kwargs) - - def create_logs( - self, - log_event_request: typing.List[LogEventRequest], - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[typing.List[LogEvent]], urllib3.HTTPResponse]: - """Method saves logs from a client on the server # noqa: E501 - - Sends logs to the ELK if it is connected # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create_logs(log_event_request, _async_call=True) - >>> result = thread.get() - - Args: - log_event_request ([LogEventRequest]): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - ([LogEvent], HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["log_event_request"] = log_event_request - return self.create_logs_endpoint.call_with_http_info(**kwargs) - - def list_share( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[typing.List[FileInfo]], urllib3.HTTPResponse]: - """Returns all files and folders that are on the server along specified path # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.list_share(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - directory (str): Directory to browse. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - ([FileInfo], HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.list_share_endpoint.call_with_http_info(**kwargs) - - def retrieve_about( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[About], urllib3.HTTPResponse]: - """Method provides basic CVAT information # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_about(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (About, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.retrieve_about_endpoint.call_with_http_info(**kwargs) - - def retrieve_annotation_formats( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[DatasetFormats], urllib3.HTTPResponse]: - """Method provides the list of supported annotations formats # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_annotation_formats(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (DatasetFormats, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.retrieve_annotation_formats_endpoint.call_with_http_info(**kwargs) - - def retrieve_plugins( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[Plugins], urllib3.HTTPResponse]: - """Method provides allowed plugins # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_plugins(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (Plugins, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.retrieve_plugins_endpoint.call_with_http_info(**kwargs) diff --git a/cvat-sdk/cvat_sdk/api/tasks_api.py b/cvat-sdk/cvat_sdk/api/tasks_api.py deleted file mode 100644 index 89b32d79..00000000 --- a/cvat-sdk/cvat_sdk/api/tasks_api.py +++ /dev/null @@ -1,3665 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import typing -from typing import TYPE_CHECKING - -import urllib3 - -from cvat_sdk.api_client import ApiClient -from cvat_sdk.api_client import Endpoint as _Endpoint -from cvat_sdk.model.data_meta_read import DataMetaRead -from cvat_sdk.model.data_request import DataRequest -from cvat_sdk.model.paginated_job_read_list import PaginatedJobReadList -from cvat_sdk.model.paginated_task_read_list import PaginatedTaskReadList -from cvat_sdk.model.patched_job_write_request import PatchedJobWriteRequest -from cvat_sdk.model.patched_task_write_request import PatchedTaskWriteRequest -from cvat_sdk.model.rq_status import RqStatus -from cvat_sdk.model.task_file_request import TaskFileRequest -from cvat_sdk.model.task_read import TaskRead -from cvat_sdk.model.task_write import TaskWrite -from cvat_sdk.model.task_write_request import TaskWriteRequest -from cvat_sdk.model_utils import date, datetime, file_type, none_type # noqa: F401 - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class TasksApi(object): - """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): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.jobs_partial_update_data_meta_endpoint = _Endpoint( - settings={ - "response_schema": (DataMetaRead,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/jobs/{id}/data/meta", - "operation_id": "jobs_partial_update_data_meta", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - "patched_job_write_request", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "patched_job_write_request": (PatchedJobWriteRequest,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "patched_job_write_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.create_endpoint = _Endpoint( - settings={ - "response_schema": (TaskWrite,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks", - "operation_id": "create", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "task_write_request", - "x_organization", - "org", - "org_id", - ], - "required": [ - "task_write_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "task_write_request": (TaskWriteRequest,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "task_write_request": "body", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.create_annotations_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/{id}/annotations/", - "operation_id": "create_annotations", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "id", - "task_write_request", - "x_organization", - "cloud_storage_id", - "filename", - "format", - "location", - "org", - "org_id", - "use_default_location", - ], - "required": [ - "id", - "task_write_request", - ], - "nullable": [], - "enum": [ - "location", - ], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": { - ("location",): {"CLOUD_STORAGE": "cloud_storage", "LOCAL": "local"}, - }, - "openapi_types": { - "id": (int,), - "task_write_request": (TaskWriteRequest,), - "x_organization": (str,), - "cloud_storage_id": (float,), - "filename": (str,), - "format": (str,), - "location": (str,), - "org": (str,), - "org_id": (int,), - "use_default_location": (bool,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "cloud_storage_id": "cloud_storage_id", - "filename": "filename", - "format": "format", - "location": "location", - "org": "org", - "org_id": "org_id", - "use_default_location": "use_default_location", - }, - "location_map": { - "id": "path", - "task_write_request": "body", - "x_organization": "header", - "cloud_storage_id": "query", - "filename": "query", - "format": "query", - "location": "query", - "org": "query", - "org_id": "query", - "use_default_location": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.create_backup_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/backup/", - "operation_id": "create_backup", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "task_file_request", - "x_organization", - "cloud_storage_id", - "filename", - "location", - "org", - "org_id", - ], - "required": [ - "task_file_request", - ], - "nullable": [], - "enum": [ - "location", - ], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": { - ("location",): {"CLOUD_STORAGE": "cloud_storage", "LOCAL": "local"}, - }, - "openapi_types": { - "task_file_request": (TaskFileRequest,), - "x_organization": (str,), - "cloud_storage_id": (float,), - "filename": (str,), - "location": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "cloud_storage_id": "cloud_storage_id", - "filename": "filename", - "location": "location", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "task_file_request": "body", - "x_organization": "header", - "cloud_storage_id": "query", - "filename": "query", - "location": "query", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.create_data_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/{id}/data/", - "operation_id": "create_data", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "id", - "data_request", - "upload_finish", - "upload_multiple", - "upload_start", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - "data_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "data_request": (DataRequest,), - "upload_finish": (bool,), - "upload_multiple": (bool,), - "upload_start": (bool,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "upload_finish": "Upload-Finish", - "upload_multiple": "Upload-Multiple", - "upload_start": "Upload-Start", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "data_request": "body", - "upload_finish": "header", - "upload_multiple": "header", - "upload_start": "header", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.destroy_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/{id}", - "operation_id": "destroy", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.destroy_annotations_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/{id}/annotations/", - "operation_id": "destroy_annotations", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.list_endpoint = _Endpoint( - settings={ - "response_schema": (PaginatedTaskReadList,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks", - "operation_id": "list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "filter", - "org", - "org_id", - "page", - "page_size", - "search", - "sort", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "filter": (str,), - "org": (str,), - "org_id": (int,), - "page": (int,), - "page_size": (int,), - "search": (str,), - "sort": (str,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "filter": "filter", - "org": "org", - "org_id": "org_id", - "page": "page", - "page_size": "page_size", - "search": "search", - "sort": "sort", - }, - "location_map": { - "x_organization": "header", - "filter": "query", - "org": "query", - "org_id": "query", - "page": "query", - "page_size": "query", - "search": "query", - "sort": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.list_jobs_endpoint = _Endpoint( - settings={ - "response_schema": (PaginatedJobReadList,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/{id}/jobs", - "operation_id": "list_jobs", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "filter", - "org", - "org_id", - "page", - "page_size", - "search", - "sort", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "filter": (str,), - "org": (str,), - "org_id": (int,), - "page": (int,), - "page_size": (int,), - "search": (str,), - "sort": (str,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "filter": "filter", - "org": "org", - "org_id": "org_id", - "page": "page", - "page_size": "page_size", - "search": "search", - "sort": "sort", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "filter": "query", - "org": "query", - "org_id": "query", - "page": "query", - "page_size": "query", - "search": "query", - "sort": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.partial_update_endpoint = _Endpoint( - settings={ - "response_schema": (TaskWrite,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/{id}", - "operation_id": "partial_update", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - "patched_task_write_request", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "patched_task_write_request": (PatchedTaskWriteRequest,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "patched_task_write_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.partial_update_annotations_endpoint = _Endpoint( - settings={ - "response_schema": (TaskWrite,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/{id}/annotations/", - "operation_id": "partial_update_annotations", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "action", - "id", - "x_organization", - "org", - "org_id", - "patched_task_write_request", - ], - "required": [ - "action", - "id", - ], - "nullable": [], - "enum": [ - "action", - ], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": { - ("action",): {"CREATE": "create", "DELETE": "delete", "UPDATE": "update"}, - }, - "openapi_types": { - "action": (str,), - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "patched_task_write_request": (PatchedTaskWriteRequest,), - }, - "attribute_map": { - "action": "action", - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "action": "query", - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "patched_task_write_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.partial_update_annotations_file_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/{id}/annotations/{file_id}", - "operation_id": "partial_update_annotations_file", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "file_id", - "id", - "x_organization", - "org", - "org_id", - "body", - ], - "required": [ - "file_id", - "id", - ], - "nullable": [], - "enum": [], - "validation": [ - "file_id", - ], - }, - root_map={ - "validations": { - ("file_id",): { - "regex": { - "pattern": r"^\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b$", # noqa: E501 - }, - }, - }, - "allowed_values": {}, - "openapi_types": { - "file_id": (str,), - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "body": (file_type,), - }, - "attribute_map": { - "file_id": "file_id", - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "file_id": "path", - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "body": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.partial_update_backup_file_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/backup/{file_id}", - "operation_id": "partial_update_backup_file", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "file_id", - "x_organization", - "org", - "org_id", - "body", - ], - "required": [ - "file_id", - ], - "nullable": [], - "enum": [], - "validation": [ - "file_id", - ], - }, - root_map={ - "validations": { - ("file_id",): { - "regex": { - "pattern": r"^\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b$", # noqa: E501 - }, - }, - }, - "allowed_values": {}, - "openapi_types": { - "file_id": (str,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "body": (file_type,), - }, - "attribute_map": { - "file_id": "file_id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "file_id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "body": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.partial_update_data_file_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/{id}/data/{file_id}", - "operation_id": "partial_update_data_file", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "file_id", - "id", - "x_organization", - "org", - "org_id", - "body", - ], - "required": [ - "file_id", - "id", - ], - "nullable": [], - "enum": [], - "validation": [ - "file_id", - ], - }, - root_map={ - "validations": { - ("file_id",): { - "regex": { - "pattern": r"^\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b$", # noqa: E501 - }, - }, - }, - "allowed_values": {}, - "openapi_types": { - "file_id": (str,), - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "body": (file_type,), - }, - "attribute_map": { - "file_id": "file_id", - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "file_id": "path", - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "body": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.partial_update_data_meta_endpoint = _Endpoint( - settings={ - "response_schema": (DataMetaRead,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/{id}/data/meta", - "operation_id": "partial_update_data_meta", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - "patched_task_write_request", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "patched_task_write_request": (PatchedTaskWriteRequest,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "patched_task_write_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.retrieve_endpoint = _Endpoint( - settings={ - "response_schema": (TaskRead,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/{id}", - "operation_id": "retrieve", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.retrieve_annotations_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/{id}/annotations/", - "operation_id": "retrieve_annotations", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "action", - "cloud_storage_id", - "filename", - "format", - "location", - "org", - "org_id", - "use_default_location", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [ - "action", - "location", - ], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": { - ("action",): {"DOWNLOAD": "download"}, - ("location",): {"CLOUD_STORAGE": "cloud_storage", "LOCAL": "local"}, - }, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "action": (str,), - "cloud_storage_id": (float,), - "filename": (str,), - "format": (str,), - "location": (str,), - "org": (str,), - "org_id": (int,), - "use_default_location": (bool,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "action": "action", - "cloud_storage_id": "cloud_storage_id", - "filename": "filename", - "format": "format", - "location": "location", - "org": "org", - "org_id": "org_id", - "use_default_location": "use_default_location", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "action": "query", - "cloud_storage_id": "query", - "filename": "query", - "format": "query", - "location": "query", - "org": "query", - "org_id": "query", - "use_default_location": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.retrieve_backup_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/{id}/backup", - "operation_id": "retrieve_backup", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "action", - "cloud_storage_id", - "filename", - "location", - "org", - "org_id", - "use_default_location", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [ - "action", - "location", - ], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": { - ("action",): {"DOWNLOAD": "download"}, - ("location",): {"CLOUD_STORAGE": "cloud_storage", "LOCAL": "local"}, - }, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "action": (str,), - "cloud_storage_id": (float,), - "filename": (str,), - "location": (str,), - "org": (str,), - "org_id": (int,), - "use_default_location": (bool,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "action": "action", - "cloud_storage_id": "cloud_storage_id", - "filename": "filename", - "location": "location", - "org": "org", - "org_id": "org_id", - "use_default_location": "use_default_location", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "action": "query", - "cloud_storage_id": "query", - "filename": "query", - "location": "query", - "org": "query", - "org_id": "query", - "use_default_location": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.retrieve_data_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/{id}/data/", - "operation_id": "retrieve_data", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "number", - "quality", - "type", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - "number", - "quality", - "type", - ], - "nullable": [], - "enum": [ - "quality", - "type", - ], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": { - ("quality",): {"COMPRESSED": "compressed", "ORIGINAL": "original"}, - ("type",): { - "CHUNK": "chunk", - "CONTEXT_IMAGE": "context_image", - "FRAME": "frame", - "PREVIEW": "preview", - }, - }, - "openapi_types": { - "id": (int,), - "number": (int,), - "quality": (str,), - "type": (str,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "number": "number", - "quality": "quality", - "type": "type", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "number": "query", - "quality": "query", - "type": "query", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.retrieve_data_meta_endpoint = _Endpoint( - settings={ - "response_schema": (DataMetaRead,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/{id}/data/meta", - "operation_id": "retrieve_data_meta", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.retrieve_dataset_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/{id}/dataset", - "operation_id": "retrieve_dataset", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "format", - "id", - "x_organization", - "action", - "cloud_storage_id", - "filename", - "location", - "org", - "org_id", - "use_default_location", - ], - "required": [ - "format", - "id", - ], - "nullable": [], - "enum": [ - "action", - "location", - ], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": { - ("action",): {"DOWNLOAD": "download"}, - ("location",): {"CLOUD_STORAGE": "cloud_storage", "LOCAL": "local"}, - }, - "openapi_types": { - "format": (str,), - "id": (int,), - "x_organization": (str,), - "action": (str,), - "cloud_storage_id": (float,), - "filename": (str,), - "location": (str,), - "org": (str,), - "org_id": (int,), - "use_default_location": (bool,), - }, - "attribute_map": { - "format": "format", - "id": "id", - "x_organization": "X-Organization", - "action": "action", - "cloud_storage_id": "cloud_storage_id", - "filename": "filename", - "location": "location", - "org": "org", - "org_id": "org_id", - "use_default_location": "use_default_location", - }, - "location_map": { - "format": "query", - "id": "path", - "x_organization": "header", - "action": "query", - "cloud_storage_id": "query", - "filename": "query", - "location": "query", - "org": "query", - "org_id": "query", - "use_default_location": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.retrieve_status_endpoint = _Endpoint( - settings={ - "response_schema": (RqStatus,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/{id}/status", - "operation_id": "retrieve_status", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.update_endpoint = _Endpoint( - settings={ - "response_schema": (TaskWrite,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/{id}", - "operation_id": "update", - "http_method": "PUT", - "servers": None, - }, - params_map={ - "all": [ - "id", - "task_write_request", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - "task_write_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "task_write_request": (TaskWriteRequest,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "task_write_request": "body", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.update_annotations_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/tasks/{id}/annotations/", - "operation_id": "update_annotations", - "http_method": "PUT", - "servers": None, - }, - params_map={ - "all": [ - "id", - "task_write_request", - "x_organization", - "format", - "org", - "org_id", - ], - "required": [ - "id", - "task_write_request", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "task_write_request": (TaskWriteRequest,), - "x_organization": (str,), - "format": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "format": "format", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "task_write_request": "body", - "x_organization": "header", - "format": "query", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - - def jobs_partial_update_data_meta( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[DataMetaRead], urllib3.HTTPResponse]: - """Method provides a meta information about media files which are related with the job # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.jobs_partial_update_data_meta(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this job. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - patched_job_write_request (PatchedJobWriteRequest): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (DataMetaRead, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.jobs_partial_update_data_meta_endpoint.call_with_http_info(**kwargs) - - def create( - self, - task_write_request: TaskWriteRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[TaskWrite], urllib3.HTTPResponse]: - """Method creates a new task in a database without any attached images and videos # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create(task_write_request, _async_call=True) - >>> result = thread.get() - - Args: - task_write_request (TaskWriteRequest): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (TaskWrite, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["task_write_request"] = task_write_request - return self.create_endpoint.call_with_http_info(**kwargs) - - def create_annotations( - self, - id: int, - task_write_request: TaskWriteRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method allows to upload task annotations from storage # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create_annotations(id, task_write_request, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this task. - task_write_request (TaskWriteRequest): - - Keyword Args: - x_organization (str): [optional] - cloud_storage_id (float): Storage id. [optional] - filename (str): Annotation file name. [optional] - format (str): Input format name You can get the list of supported formats at: /server/annotation/formats. [optional] - location (str): where to import the annotation from. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - use_default_location (bool): Use the location that was configured in task to import annotations. [optional] if omitted the server will use the default value of True - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - kwargs["task_write_request"] = task_write_request - return self.create_annotations_endpoint.call_with_http_info(**kwargs) - - def create_backup( - self, - task_file_request: TaskFileRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method recreates a task from an attached task backup file # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create_backup(task_file_request, _async_call=True) - >>> result = thread.get() - - Args: - task_file_request (TaskFileRequest): - - Keyword Args: - x_organization (str): [optional] - cloud_storage_id (float): Storage id. [optional] - filename (str): Backup file name. [optional] - location (str): Where to import the backup file from. [optional] if omitted the server will use the default value of "local" - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["task_file_request"] = task_file_request - return self.create_backup_endpoint.call_with_http_info(**kwargs) - - def create_data( - self, - id: int, - data_request: DataRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method permanently attaches images or video to a task. Supports tus uploads, see more https://tus.io/ # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.create_data(id, data_request, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this task. - data_request (DataRequest): - - Keyword Args: - upload_finish (bool): Finishes data upload. Can be combined with Upload-Start header to create task data with one request. [optional] - upload_multiple (bool): Indicates that data with this request are single or multiple files that should be attached to a task. [optional] - upload_start (bool): Initializes data upload. No data should be sent with this header. [optional] - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - kwargs["data_request"] = data_request - return self.create_data_endpoint.call_with_http_info(**kwargs) - - def destroy( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method deletes a specific task, all attached jobs, annotations, and data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.destroy(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this task. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.destroy_endpoint.call_with_http_info(**kwargs) - - def destroy_annotations( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method deletes all annotations for a specific task # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.destroy_annotations(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this task. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.destroy_annotations_endpoint.call_with_http_info(**kwargs) - - def list( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[PaginatedTaskReadList], urllib3.HTTPResponse]: - """Returns a paginated list of tasks according to query parameters (10 tasks per page) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.list(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - filter (str): A filter term. Avaliable filter_fields: ['project_name', 'name', 'owner', 'status', 'assignee', 'subset', 'mode', 'dimension', 'id', 'project_id', 'updated_date']. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - page (int): A page number within the paginated result set.. [optional] - page_size (int): Number of results to return per page.. [optional] - search (str): A search term. Avaliable search_fields: ('project_name', 'name', 'owner', 'status', 'assignee', 'subset', 'mode', 'dimension'). [optional] - sort (str): Which field to use when ordering the results. Avaliable ordering_fields: ['project_name', 'name', 'owner', 'status', 'assignee', 'subset', 'mode', 'dimension', 'id', 'project_id', 'updated_date']. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (PaginatedTaskReadList, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.list_endpoint.call_with_http_info(**kwargs) - - def list_jobs( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[PaginatedJobReadList], urllib3.HTTPResponse]: - """Method returns a list of jobs for a specific task # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.list_jobs(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this task. - - Keyword Args: - x_organization (str): [optional] - filter (str): A filter term. Avaliable filter_fields: ['project_name', 'name', 'owner', 'status', 'assignee', 'subset', 'mode', 'dimension', 'id', 'project_id', 'updated_date']. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - page (int): A page number within the paginated result set.. [optional] - page_size (int): Number of results to return per page.. [optional] - search (str): A search term. Avaliable search_fields: ('project_name', 'name', 'owner', 'status', 'assignee', 'subset', 'mode', 'dimension'). [optional] - sort (str): Which field to use when ordering the results. Avaliable ordering_fields: ['project_name', 'name', 'owner', 'status', 'assignee', 'subset', 'mode', 'dimension', 'id', 'project_id', 'updated_date']. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (PaginatedJobReadList, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.list_jobs_endpoint.call_with_http_info(**kwargs) - - def partial_update( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[TaskWrite], urllib3.HTTPResponse]: - """Methods does a partial update of chosen fields in a task # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.partial_update(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this task. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - patched_task_write_request (PatchedTaskWriteRequest): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (TaskWrite, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.partial_update_endpoint.call_with_http_info(**kwargs) - - def partial_update_annotations( - self, - action: str, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[TaskWrite], urllib3.HTTPResponse]: - """Method performs a partial update of annotations in a specific task # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.partial_update_annotations(action, id, _async_call=True) - >>> result = thread.get() - - Args: - action (str): - id (int): A unique integer value identifying this task. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - patched_task_write_request (PatchedTaskWriteRequest): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (TaskWrite, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["action"] = action - kwargs["id"] = id - return self.partial_update_annotations_endpoint.call_with_http_info(**kwargs) - - def partial_update_annotations_file( - self, - file_id: str, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Allows to upload an annotation file chunk. Implements TUS file uploading protocol. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.partial_update_annotations_file(file_id, id, _async_call=True) - >>> result = thread.get() - - Args: - file_id (str): - id (int): A unique integer value identifying this task. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - body (file_type): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["file_id"] = file_id - kwargs["id"] = id - return self.partial_update_annotations_file_endpoint.call_with_http_info(**kwargs) - - def partial_update_backup_file( - self, - file_id: str, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Allows to upload a file chunk. Implements TUS file uploading protocol. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.partial_update_backup_file(file_id, _async_call=True) - >>> result = thread.get() - - Args: - file_id (str): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - body (file_type): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["file_id"] = file_id - return self.partial_update_backup_file_endpoint.call_with_http_info(**kwargs) - - def partial_update_data_file( - self, - file_id: str, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Allows to upload a file chunk. Implements TUS file uploading protocol. # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.partial_update_data_file(file_id, id, _async_call=True) - >>> result = thread.get() - - Args: - file_id (str): - id (int): A unique integer value identifying this task. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - body (file_type): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["file_id"] = file_id - kwargs["id"] = id - return self.partial_update_data_file_endpoint.call_with_http_info(**kwargs) - - def partial_update_data_meta( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[DataMetaRead], urllib3.HTTPResponse]: - """Method provides a meta information about media files which are related with the task # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.partial_update_data_meta(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this task. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - patched_task_write_request (PatchedTaskWriteRequest): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (DataMetaRead, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.partial_update_data_meta_endpoint.call_with_http_info(**kwargs) - - def retrieve( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[TaskRead], urllib3.HTTPResponse]: - """Method returns details of a specific task # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this task. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (TaskRead, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.retrieve_endpoint.call_with_http_info(**kwargs) - - def retrieve_annotations( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method allows to download task annotations # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_annotations(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this task. - - Keyword Args: - x_organization (str): [optional] - action (str): Used to start downloading process after annotation file had been created. [optional] if omitted the server will use the default value of "download" - cloud_storage_id (float): Storage id. [optional] - filename (str): Desired output file name. [optional] - format (str): Desired output format name You can get the list of supported formats at: /server/annotation/formats. [optional] - location (str): Where need to save downloaded dataset. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - use_default_location (bool): Use the location that was configured in the task to export annotation. [optional] if omitted the server will use the default value of True - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.retrieve_annotations_endpoint.call_with_http_info(**kwargs) - - def retrieve_backup( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method backup a specified task # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_backup(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this task. - - Keyword Args: - x_organization (str): [optional] - action (str): Used to start downloading process after backup file had been created. [optional] if omitted the server will use the default value of "download" - cloud_storage_id (float): Storage id. [optional] - filename (str): Backup file name. [optional] - location (str): Where need to save downloaded backup. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - use_default_location (bool): Use the location that was configured in the task to export backup. [optional] if omitted the server will use the default value of True - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.retrieve_backup_endpoint.call_with_http_info(**kwargs) - - def retrieve_data( - self, - id: int, - number: int, - quality: str, - type: str, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method returns data for a specific task # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_data(id, number, quality, type, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this task. - number (int): A unique number value identifying chunk or frame, doesn't matter for 'preview' type - quality (str): Specifies the quality level of the requested data, doesn't matter for 'preview' type - type (str): Specifies the type of the requested data - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - kwargs["number"] = number - kwargs["quality"] = quality - kwargs["type"] = type - return self.retrieve_data_endpoint.call_with_http_info(**kwargs) - - def retrieve_data_meta( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[DataMetaRead], urllib3.HTTPResponse]: - """Method provides a meta information about media files which are related with the task # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_data_meta(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this task. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (DataMetaRead, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.retrieve_data_meta_endpoint.call_with_http_info(**kwargs) - - def retrieve_dataset( - self, - format: str, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Export task as a dataset in a specific format # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_dataset(format, id, _async_call=True) - >>> result = thread.get() - - Args: - format (str): Desired output format name You can get the list of supported formats at: /server/annotation/formats - id (int): A unique integer value identifying this task. - - Keyword Args: - x_organization (str): [optional] - action (str): Used to start downloading process after annotation file had been created. [optional] if omitted the server will use the default value of "download" - cloud_storage_id (float): Storage id. [optional] - filename (str): Desired output file name. [optional] - location (str): Where need to save downloaded dataset. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - use_default_location (bool): Use the location that was configured in task to export annotations. [optional] if omitted the server will use the default value of True - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["format"] = format - kwargs["id"] = id - return self.retrieve_dataset_endpoint.call_with_http_info(**kwargs) - - def retrieve_status( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[RqStatus], urllib3.HTTPResponse]: - """When task is being created the method returns information about a status of the creation process # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_status(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this task. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (RqStatus, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.retrieve_status_endpoint.call_with_http_info(**kwargs) - - def update( - self, - id: int, - task_write_request: TaskWriteRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[TaskWrite], urllib3.HTTPResponse]: - """Method updates a task by id # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.update(id, task_write_request, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this task. - task_write_request (TaskWriteRequest): - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (TaskWrite, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - kwargs["task_write_request"] = task_write_request - return self.update_endpoint.call_with_http_info(**kwargs) - - def update_annotations( - self, - id: int, - task_write_request: TaskWriteRequest, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method allows to upload task annotations # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.update_annotations(id, task_write_request, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this task. - task_write_request (TaskWriteRequest): - - Keyword Args: - x_organization (str): [optional] - format (str): Input format name You can get the list of supported formats at: /server/annotation/formats. [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - kwargs["task_write_request"] = task_write_request - return self.update_annotations_endpoint.call_with_http_info(**kwargs) diff --git a/cvat-sdk/cvat_sdk/api/users_api.py b/cvat-sdk/cvat_sdk/api/users_api.py deleted file mode 100644 index da1ac285..00000000 --- a/cvat-sdk/cvat_sdk/api/users_api.py +++ /dev/null @@ -1,725 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import typing -from typing import TYPE_CHECKING - -import urllib3 - -from cvat_sdk.api_client import ApiClient -from cvat_sdk.api_client import Endpoint as _Endpoint -from cvat_sdk.model.meta_user import MetaUser -from cvat_sdk.model.paginated_meta_user_list import PaginatedMetaUserList -from cvat_sdk.model.patched_user_request import PatchedUserRequest -from cvat_sdk.model_utils import date, datetime, file_type, none_type # noqa: F401 - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class UsersApi(object): - """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): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.destroy_endpoint = _Endpoint( - settings={ - "response_schema": None, - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/users/{id}", - "operation_id": "destroy", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.list_endpoint = _Endpoint( - settings={ - "response_schema": (PaginatedMetaUserList,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/users", - "operation_id": "list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "filter", - "org", - "org_id", - "page", - "page_size", - "search", - "sort", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "filter": (str,), - "org": (str,), - "org_id": (int,), - "page": (int,), - "page_size": (int,), - "search": (str,), - "sort": (str,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "filter": "filter", - "org": "org", - "org_id": "org_id", - "page": "page", - "page_size": "page_size", - "search": "search", - "sort": "sort", - }, - "location_map": { - "x_organization": "header", - "filter": "query", - "org": "query", - "org_id": "query", - "page": "query", - "page_size": "query", - "search": "query", - "sort": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.partial_update_endpoint = _Endpoint( - settings={ - "response_schema": (MetaUser,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/users/{id}", - "operation_id": "partial_update", - "http_method": "PATCH", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - "patched_user_request", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - "patched_user_request": (PatchedUserRequest,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - "patched_user_request": "body", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [ - "application/json", - "application/x-www-form-urlencoded", - "multipart/form-data", - "application/offset+octet-stream", - ], - }, - api_client=api_client, - ) - self.retrieve_endpoint = _Endpoint( - settings={ - "response_schema": (MetaUser,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/users/{id}", - "operation_id": "retrieve", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "x_organization", - "org", - "org_id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (int,), - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "id": "id", - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "id": "path", - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - self.retrieve_self_endpoint = _Endpoint( - settings={ - "response_schema": (MetaUser,), - "auth": ["SignatureAuthentication", "basicAuth", "cookieAuth", "tokenAuth"], - "endpoint_path": "/api/users/self", - "operation_id": "retrieve_self", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "x_organization", - "org", - "org_id", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_organization": (str,), - "org": (str,), - "org_id": (int,), - }, - "attribute_map": { - "x_organization": "X-Organization", - "org": "org", - "org_id": "org_id", - }, - "location_map": { - "x_organization": "header", - "org": "query", - "org_id": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/vnd.cvat+json"], - "content_type": [], - }, - api_client=api_client, - ) - - def destroy( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[None], urllib3.HTTPResponse]: - """Method deletes a specific user from the server # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.destroy(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this user. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (None, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.destroy_endpoint.call_with_http_info(**kwargs) - - def list( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[PaginatedMetaUserList], urllib3.HTTPResponse]: - """Method provides a paginated list of users registered on the server # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.list(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - filter (str): A filter term. Avaliable filter_fields: ('id', 'is_active', 'username'). [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - page (int): A page number within the paginated result set.. [optional] - page_size (int): Number of results to return per page.. [optional] - search (str): A search term. Avaliable search_fields: ('username', 'first_name', 'last_name'). [optional] - sort (str): Which field to use when ordering the results. Avaliable ordering_fields: ('id', 'is_active', 'username'). [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (PaginatedMetaUserList, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.list_endpoint.call_with_http_info(**kwargs) - - def partial_update( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[MetaUser], urllib3.HTTPResponse]: - """Method updates chosen fields of a user # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.partial_update(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this user. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - patched_user_request (PatchedUserRequest): [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (MetaUser, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.partial_update_endpoint.call_with_http_info(**kwargs) - - def retrieve( - self, - id: int, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[MetaUser], urllib3.HTTPResponse]: - """Method provides information of a specific user # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve(id, _async_call=True) - >>> result = thread.get() - - Args: - id (int): A unique integer value identifying this user. - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (MetaUser, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - kwargs["id"] = id - return self.retrieve_endpoint.call_with_http_info(**kwargs) - - def retrieve_self( - self, - *, - _parse_response: bool = True, - _request_timeout: typing.Union[int, float, tuple] = None, - _validate_inputs: bool = True, - _validate_outputs: bool = True, - _check_status: bool = True, - _spec_property_naming: bool = False, - _content_type: typing.Optional[str] = None, - _host_index: typing.Optional[int] = None, - _request_auths: typing.Optional[typing.List] = None, - _async_call: bool = False, - **kwargs, - ) -> typing.Tuple[typing.Optional[MetaUser], urllib3.HTTPResponse]: - """Method returns an instance of a user who is currently authorized # noqa: E501 - - Method returns an instance of a user who is currently authorized # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass _async_call=True - - >>> thread = api.retrieve_self(_async_call=True) - >>> result = thread.get() - - - Keyword Args: - x_organization (str): [optional] - org (str): Organization unique slug. [optional] - org_id (int): Organization identifier. [optional] - _parse_response (bool): if False, the response data will not be parsed, - None is returned for data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _check_status (bool): whether to check response status - for being positive or not. - Default is True - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (MetaUser, HTTPResponse) - If the method is called asynchronously, returns the request - thread. - """ - kwargs["_async_call"] = _async_call - kwargs["_parse_response"] = _parse_response - kwargs["_request_timeout"] = _request_timeout - kwargs["_validate_inputs"] = _validate_inputs - kwargs["_validate_outputs"] = _validate_outputs - kwargs["_check_status"] = _check_status - kwargs["_spec_property_naming"] = _spec_property_naming - kwargs["_content_type"] = _content_type - kwargs["_host_index"] = _host_index - kwargs["_request_auths"] = _request_auths - return self.retrieve_self_endpoint.call_with_http_info(**kwargs) diff --git a/cvat-sdk/cvat_sdk/api_client.py b/cvat-sdk/cvat_sdk/api_client.py deleted file mode 100644 index b10750b7..00000000 --- a/cvat-sdk/cvat_sdk/api_client.py +++ /dev/null @@ -1,1080 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import atexit -import importlib -import io -import json -import mimetypes -import os -import re -import typing -from multiprocessing.pool import ThreadPool -from typing import TYPE_CHECKING -from urllib.parse import quote - -from urllib3 import HTTPResponse -from urllib3.fields import RequestField - -from cvat_sdk import rest -from cvat_sdk.configuration import Configuration -from cvat_sdk.exceptions import ApiException, ApiTypeError, ApiValueError -from cvat_sdk.model_utils import ( - ModelComposed, - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - deserialize_file, - file_type, - model_to_dict, - none_type, - validate_and_convert_types, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class ApiClient(object): - """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. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - Class members: - - auth_api: AuthApi - cloud_storages_api: CloudStoragesApi - comments_api: CommentsApi - invitations_api: InvitationsApi - issues_api: IssuesApi - jobs_api: JobsApi - lambda_api: LambdaApi - memberships_api: MembershipsApi - organizations_api: OrganizationsApi - projects_api: ProjectsApi - restrictions_api: RestrictionsApi - schema_api: SchemaApi - server_api: ServerApi - tasks_api: TasksApi - users_api: UsersApi - """ - - _pool = None - - def __init__( - self, configuration=None, header_name=None, header_value=None, cookie=None, pool_threads=1 - ): - """ - :param configuration: configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - if configuration is None: - configuration = Configuration.get_default_copy() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = "OpenAPI-Generator/2.0-alpha/python" - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, "unregister"): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers["User-Agent"] - - @user_agent.setter - def user_agent(self, value): - self.default_headers["User-Agent"] = value - - def _serialize_post_parameter(self, obj): - if isinstance(obj, (str, int, float, none_type, bool)): - return ("", json.dumps(obj), "application/json") - elif isinstance(obj, io.IOBase): - return self._serialize_file(obj) - raise ApiValueError( - "Unable to prepare type {} for serialization".format(obj.__class__.__name__) - ) - - def _convert_body_to_post_params(self, body): - # body must be a flat structure, lists of primitives is possible - body = self.sanitize_for_serialization(body, read_files=False) - assert isinstance(body, dict), type(body) - - post_params = [] - for k, v in body.items(): - if isinstance(v, (tuple, list)): - for i, entry in enumerate(v): - post_params.append((f"{k}[{i}]", self._serialize_post_parameter(entry))) - else: - post_params.append((k, self._serialize_post_parameter(v))) - return post_params - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - def __call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_schema: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - *, - _parse_response: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _check_status: bool = True, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None, - ): - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - if self.cookie: - header_params["Cookie"] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, collection_formats)) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, collection_formats) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace( - "{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param) - ) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, collection_formats) - - # post parameters - post_params = post_params if post_params else [] - if post_params or files: - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, collection_formats) - post_params.extend(self.files_parameters(files)) - - if header_params.get("Content-Type", "").startswith("multipart"): - if body: - post_params.extend(self._convert_body_to_post_params(body)) - body = None - - if post_params: - post_params = self.parameters_to_multipart(post_params, (dict)) - else: - # body - if body: - body = self.sanitize_for_serialization(body) - - # auth setting - self.update_params_for_auth( - header_params, - query_params, - auth_settings, - resource_path, - method, - body, - request_auths=_request_auths, - ) - - # request url - if _host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = _host + resource_path - - try: - # perform request and return response - response = self.request( - method, - url, - query_params=query_params, - headers=header_params, - post_params=post_params, - body=body, - _parse_response=_parse_response, - _request_timeout=_request_timeout, - _check_status=_check_status, - ) - except ApiException as e: - e.body = e.body.decode("utf-8") - raise e - - self.last_response = response - - return_data = None - if _parse_response and response_schema: - return_data = self.deserialize(response, response_schema, _check_type=_check_type) - - return (return_data, response) - - def parameters_to_multipart(self, params, collection_types): - """Get parameters as list of tuples, formatting as json if value is collection_types - - :param params: Parameters as list of two-tuples - :param dict collection_types: Parameter collection types - :return: Parameters as list of tuple or urllib3.fields.RequestField - """ - new_params = [] - if collection_types is None: - collection_types = dict - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance( - v, collection_types - ): # v is instance of collection_type, formatting as application/json - v = json.dumps(v, ensure_ascii=False).encode("utf-8") - field = RequestField(k, v) - field.make_multipart(content_type="application/json; charset=utf-8") - new_params.append(field) - else: - new_params.append((k, v)) - return new_params - - @classmethod - def sanitize_for_serialization(cls, obj, *, read_files: bool = True): - """Prepares data for transmission before it is sent with the rest client - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - If obj is io.IOBase, return the bytes - :param obj: The data to serialize. - :param read_files: Whether to read file data or leave files as is. - :return: The serialized form of data. - """ - if isinstance(obj, (ModelNormal, ModelComposed)): - return { - key: cls.sanitize_for_serialization(val, read_files=read_files) - for key, val in model_to_dict(obj, serialize=True).items() - } - elif isinstance(obj, io.IOBase): - if read_files: - return cls.get_file_data_and_close_file(obj) - else: - return obj - elif isinstance(obj, (str, int, float, none_type, bool)): - return obj - elif isinstance(obj, (datetime, date)): - return obj.isoformat() - elif isinstance(obj, ModelSimple): - return cls.sanitize_for_serialization(obj.value, read_files=read_files) - elif isinstance(obj, (list, tuple)): - return [cls.sanitize_for_serialization(item, read_files=read_files) for item in obj] - if isinstance(obj, dict): - return { - key: cls.sanitize_for_serialization(val, read_files=read_files) - for key, val in obj.items() - } - raise ApiValueError( - "Unable to prepare type {} for serialization".format(obj.__class__.__name__) - ) - - def deserialize( - self, response: HTTPResponse, response_schema: typing.Tuple, *, _check_type: bool - ): - """Deserializes response into an object. - - :param response (urllib3.HTTPResponse): object to be deserialized. - :param response_schema: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param _check_type (bool): whether to check the types of the data - received from the server - - :return: deserialized object - """ - - if response_schema == (file_type,): - # handle file downloading - # save response body into a tmp file and return the instance - content_disposition = response.getheader("Content-Disposition") - return deserialize_file( - response.data, self.configuration, content_disposition=content_disposition - ) - - encoding = "utf-8" - content_type = response.getheader("content-type") - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - if match: - encoding = match.group(1) - response_data = response.data.decode(encoding) - - # fetch data from response object - try: - received_data = json.loads(response_data) - except ValueError: - received_data = response_data - - # store our data under the key of 'received_data' so users have some - # context if they are deserializing a string and the data type is wrong - deserialized_data = validate_and_convert_types( - received_data, - response_schema, - ["received_data"], - True, - _check_type, - configuration=self.configuration, - ) - return deserialized_data - - def call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_schema: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - *, - _async_call: typing.Optional[bool] = None, - _parse_response: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None, - _check_status: bool = True, - ): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an _async_call request, set the _async_call parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response_schema: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param files: key -> field name, value -> a list of open file - objects for `multipart/form-data`. - :type files: dict - :param _async_call bool: execute request asynchronously - :type _async_call: bool, optional - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :type collection_formats: dict, optional - :param _parse_response: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _parse_response: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _check_type: boolean describing if the data back from the server - should have its type checked. - :type _check_type: bool, optional - :param _request_auths: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auths: list, optional - :return: - If _async_call parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter _async_call is False or missing, - then the method will return the response directly. - """ - params = { - "resource_path": resource_path, - "method": method, - "path_params": path_params, - "query_params": query_params, - "header_params": header_params, - "body": body, - "post_params": post_params, - "files": files, - "response_schema": response_schema, - "auth_settings": auth_settings, - "collection_formats": collection_formats, - "_parse_response": _parse_response, - "_request_timeout": _request_timeout, - "_host": _host, - "_check_type": _check_type, - "_request_auths": _request_auths, - "_check_status": _check_status, - } - - if not _async_call: - return self.__call_api(**params) - - return self.pool.apply_async(self.__call_api, (), kwds=params) - - def request( - self, - method, - url, - query_params=None, - headers=None, - post_params=None, - body=None, - *, - _parse_response=True, - _request_timeout=None, - _check_status=True, - ): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET( - url, - query_params=query_params, - _parse_response=_parse_response, - _request_timeout=_request_timeout, - headers=headers, - _check_status=_check_status, - ) - elif method == "HEAD": - return self.rest_client.HEAD( - url, - query_params=query_params, - _parse_response=_parse_response, - _request_timeout=_request_timeout, - headers=headers, - _check_status=_check_status, - ) - elif method == "OPTIONS": - return self.rest_client.OPTIONS( - url, - query_params=query_params, - headers=headers, - post_params=post_params, - _parse_response=_parse_response, - _request_timeout=_request_timeout, - _check_status=_check_status, - body=body, - ) - elif method == "POST": - return self.rest_client.POST( - url, - query_params=query_params, - headers=headers, - post_params=post_params, - _parse_response=_parse_response, - _request_timeout=_request_timeout, - _check_status=_check_status, - body=body, - ) - elif method == "PUT": - return self.rest_client.PUT( - url, - query_params=query_params, - headers=headers, - post_params=post_params, - _parse_response=_parse_response, - _request_timeout=_request_timeout, - _check_status=_check_status, - body=body, - ) - elif method == "PATCH": - return self.rest_client.PATCH( - url, - query_params=query_params, - headers=headers, - post_params=post_params, - _parse_response=_parse_response, - _request_timeout=_request_timeout, - _check_status=_check_status, - body=body, - ) - elif method == "DELETE": - return self.rest_client.DELETE( - url, - query_params=query_params, - headers=headers, - _parse_response=_parse_response, - _request_timeout=_request_timeout, - _check_status=_check_status, - body=body, - ) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == "multi": - new_params.extend((k, value) for value in v) - else: - if collection_format == "ssv": - delimiter = " " - elif collection_format == "tsv": - delimiter = "\t" - elif collection_format == "pipes": - delimiter = "|" - else: # csv is the default - delimiter = "," - new_params.append((k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - @staticmethod - def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: - file_data = file_instance.read() - file_instance.close() - return file_data - - def _serialize_file( - self, file_instance: io.IOBase - ) -> typing.Tuple[str, typing.Union[str, bytes], str]: - if file_instance.closed is True: - raise ApiValueError("Cannot read a closed file.") - filename = os.path.basename(file_instance.name) - - filedata = self.get_file_data_and_close_file(file_instance) - - mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" - - return filename, filedata, mimetype - - def files_parameters( - self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None - ): - """Builds form parameters. - - :param files: None or a dict with key=param_name and - value is a list of open file objects - :return: List of tuples of form parameters with file data - """ - if files is None: - return [] - - params = [] - for param_name, file_instances in files.items(): - if file_instances is None: - # if the file field is nullable, skip None values - continue - for file_instance in file_instances: - if file_instance is None: - # if the file field is nullable, skip None values - continue - - try: - params.append((param_name, self._serialize_file(file_instance))) - except ApiValueError as e: - raise ApiValueError( - "The passed in file_type " "for %s must be open." % param_name - ) from e - - return params - - def select_header_accept(self, accepts): - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return - - accepts = [x.lower() for x in accepts] - - if "application/json" in accepts: - return "application/json" - else: - return ", ".join(accepts) - - def select_header_content_type(self, content_types, method=None, body=None): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return None - - content_types = [x.lower() for x in content_types] - - if ( - method == "PATCH" - and "application/json-patch+json" in content_types - and isinstance(body, list) - ): - return "application/json-patch+json" - - if "application/json" in content_types or "*/*" in content_types: - return "application/json" - else: - return content_types[0] - - def update_params_for_auth( - self, headers, queries, auth_settings, resource_path, method, body, request_auths=None - ): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - :param resource_path: A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method. - :param body: A object representing the body of the HTTP request. - The object type is the return value of _encoder.default(). - :param request_auths: if set, the provided settings will - override the token in the configuration. - """ - if not auth_settings: - return - - if request_auths: - for auth_setting in request_auths: - self._apply_auth_params(headers, queries, resource_path, method, body, auth_setting) - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params(headers, queries, resource_path, method, body, auth_setting) - - def _apply_auth_params(self, headers, queries, resource_path, method, body, auth_setting): - if auth_setting["in"] == "cookie": - headers["Cookie"] = auth_setting["key"] + "=" + auth_setting["value"] - elif auth_setting["in"] == "header": - if auth_setting["type"] != "http-signature": - headers[auth_setting["key"]] = auth_setting["value"] - elif auth_setting["in"] == "query": - queries.append((auth_setting["key"], auth_setting["value"])) - else: - raise ApiValueError("Authentication token must be in `query` or `header`") - - auth_api: "AuthApi" - cloud_storages_api: "CloudStoragesApi" - comments_api: "CommentsApi" - invitations_api: "InvitationsApi" - issues_api: "IssuesApi" - jobs_api: "JobsApi" - lambda_api: "LambdaApi" - memberships_api: "MembershipsApi" - organizations_api: "OrganizationsApi" - projects_api: "ProjectsApi" - restrictions_api: "RestrictionsApi" - schema_api: "SchemaApi" - server_api: "ServerApi" - tasks_api: "TasksApi" - users_api: "UsersApi" - - _apis: typing.Dict[str, object] = { - "auth_api": [None, "AuthApi"], - "cloud_storages_api": [None, "CloudStoragesApi"], - "comments_api": [None, "CommentsApi"], - "invitations_api": [None, "InvitationsApi"], - "issues_api": [None, "IssuesApi"], - "jobs_api": [None, "JobsApi"], - "lambda_api": [None, "LambdaApi"], - "memberships_api": [None, "MembershipsApi"], - "organizations_api": [None, "OrganizationsApi"], - "projects_api": [None, "ProjectsApi"], - "restrictions_api": [None, "RestrictionsApi"], - "schema_api": [None, "SchemaApi"], - "server_api": [None, "ServerApi"], - "tasks_api": [None, "TasksApi"], - "users_api": [None, "UsersApi"], - } - - def _make_api_instance(self, klass_name): - package = __name__.rsplit(".", maxsplit=1)[0] - module = importlib.import_module(package + ".apis") - api_klass = getattr(module, klass_name) - return api_klass(self) - - def __getattr__(self, key): - notfound = object() - api_instance, api_klassname = self._apis.get(key, notfound) - if api_instance is notfound: - raise AttributeError(f"Can't find the '{key}' attribute") - - if api_instance is None: - api_instance = self._make_api_instance(api_klassname) - setattr(self, key, api_instance) - - return api_instance - - -class Endpoint(object): - def __init__( - self, - settings: typing.Optional[typing.Dict[str, typing.Any]] = None, - params_map: typing.Optional[typing.Dict[str, typing.Any]] = None, - root_map: typing.Optional[typing.Dict[str, typing.Any]] = None, - headers_map: typing.Optional[typing.Dict[str, typing.Any]] = None, - api_client: typing.Optional[ApiClient] = None, - ): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_schema' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map (dict): - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - """ - - self.settings = settings - self.params_map = params_map - self.params_map["all"].extend( - [ - "_async_call", - "_host_index", - "_parse_response", - "_request_timeout", - "_validate_inputs", - "_validate_outputs", - "_check_status", - "_content_type", - "_spec_property_naming", - "_request_auths", - ] - ) - self.params_map["nullable"].extend(["_request_timeout"]) - self.validations = root_map["validations"] - self.allowed_values = root_map["allowed_values"] - self.openapi_types = root_map["openapi_types"] - extra_types = { - "_async_call": (bool,), - "_host_index": (none_type, int), - "_parse_response": (bool,), - "_request_timeout": (none_type, float, (float,), [float], int, (int,), [int]), - "_validate_inputs": (bool,), - "_validate_outputs": (bool,), - "_check_status": (bool,), - "_spec_property_naming": (bool,), - "_content_type": (none_type, str), - "_request_auths": (none_type, list), - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map["attribute_map"] - self.location_map = root_map["location_map"] - self.collection_format_map = root_map["collection_format_map"] - self.headers_map = headers_map - self.api_client = api_client - - def __validate_inputs(self, kwargs): - for param in self.params_map["enum"]: - if param in kwargs: - check_allowed_values(self.allowed_values, (param,), kwargs[param]) - - for param in self.params_map["validation"]: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param], - configuration=self.api_client.configuration, - ) - - if kwargs["_validate_inputs"] is False: - return - - for key, value in kwargs.items(): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - kwargs["_spec_property_naming"], - kwargs["_validate_inputs"], - configuration=self.api_client.configuration, - ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - "body": None, - "collection_format": {}, - "file": {}, - "form": [], - "header": {}, - "path": {}, - "query": [], - } - - for param_name, param_value in kwargs.items(): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == "body": - params["body"] = param_value - continue - base_name = self.attribute_map[param_name] - if param_location == "form" and self.openapi_types[param_name] == (file_type,): - params["file"][base_name] = [param_value] - elif param_location == "form" and self.openapi_types[param_name] == ([file_type],): - # param_value is already a list - params["file"][base_name] = param_value - elif param_location in {"form", "query"}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {"form", "query"}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params["collection_format"][base_name] = collection_format - - return params - - def call_with_http_info( - self, **kwargs - ) -> typing.Tuple[typing.Optional[typing.Any], HTTPResponse]: - """ - Keyword Args: - endpoint args - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _validate_inputs (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _validate_outputs (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - _async_call (bool): execute request asynchronously - - Returns: - (parsed_model, response) - If the method is called asynchronously, returns the request - thread. - """ - - try: - index = ( - self.api_client.configuration.server_operation_index.get( - self.settings["operation_id"], self.api_client.configuration.server_index - ) - if kwargs["_host_index"] is None - else kwargs["_host_index"] - ) - server_variables = self.api_client.configuration.server_operation_variables.get( - self.settings["operation_id"], self.api_client.configuration.server_variables - ) - _host = self.api_client.configuration.get_host_from_settings( - index, variables=server_variables, servers=self.settings["servers"] - ) - except IndexError: - if self.settings["servers"]: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % len(self.settings["servers"]) - ) - _host = None - - for key, value in kwargs.items(): - if key not in self.params_map["all"]: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % (key, self.settings["operation_id"]) - ) - # only throw this nullable ApiValueError if _validate_inputs - # is False, if _validate_inputs==True we catch this case - # in self.__validate_inputs - if ( - key not in self.params_map["nullable"] - and value is None - and kwargs["_validate_inputs"] is False - ): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % (key, self.settings["operation_id"]) - ) - - for key in self.params_map["required"]: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings["operation_id"]) - ) - - self.__validate_inputs(kwargs) - - params = self.__gather_params(kwargs) - - accept_headers_list = self.headers_map["accept"] - if accept_headers_list: - params["header"]["Accept"] = self.api_client.select_header_accept(accept_headers_list) - - if kwargs.get("_content_type"): - params["header"]["Content-Type"] = kwargs["_content_type"] - else: - content_type_headers_list = self.headers_map["content_type"] - if content_type_headers_list: - if params["body"] != "": - content_types_list = self.api_client.select_header_content_type( - content_type_headers_list, self.settings["http_method"], params["body"] - ) - if content_types_list: - params["header"]["Content-Type"] = content_types_list - - return self.api_client.call_api( - self.settings["endpoint_path"], - self.settings["http_method"], - params["path"], - params["query"], - params["header"], - body=params["body"], - post_params=params["form"], - files=params["file"], - response_schema=self.settings["response_schema"], - auth_settings=self.settings["auth"], - _async_call=kwargs["_async_call"], - _check_type=kwargs["_validate_outputs"], - _check_status=kwargs["_check_status"], - _parse_response=kwargs["_parse_response"], - _request_timeout=kwargs["_request_timeout"], - _host=_host, - _request_auths=kwargs["_request_auths"], - collection_formats=params["collection_format"], - ) diff --git a/cvat-sdk/cvat_sdk/apis/__init__.py b/cvat-sdk/cvat_sdk/apis/__init__.py deleted file mode 100644 index 613edff2..00000000 --- a/cvat-sdk/cvat_sdk/apis/__init__.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -# Import all APIs into this package. -# If you have many APIs here with many many models used in each API this may -# raise a `RecursionError`. -# In order to avoid this, import only the API that you directly need like: -# -# from cvat_sdk.api.auth_api import AuthApi -# -# or import this package, but before doing it, use: -# -# import sys -# sys.setrecursionlimit(n) - -# Import APIs into API package: -from cvat_sdk.api.auth_api import AuthApi -from cvat_sdk.api.cloud_storages_api import CloudStoragesApi -from cvat_sdk.api.comments_api import CommentsApi -from cvat_sdk.api.invitations_api import InvitationsApi -from cvat_sdk.api.issues_api import IssuesApi -from cvat_sdk.api.jobs_api import JobsApi -from cvat_sdk.api.lambda_api import LambdaApi -from cvat_sdk.api.memberships_api import MembershipsApi -from cvat_sdk.api.organizations_api import OrganizationsApi -from cvat_sdk.api.projects_api import ProjectsApi -from cvat_sdk.api.restrictions_api import RestrictionsApi -from cvat_sdk.api.schema_api import SchemaApi -from cvat_sdk.api.server_api import ServerApi -from cvat_sdk.api.tasks_api import TasksApi -from cvat_sdk.api.users_api import UsersApi diff --git a/cvat-sdk/cvat_sdk/configuration.py b/cvat-sdk/cvat_sdk/configuration.py deleted file mode 100644 index b30421d5..00000000 --- a/cvat-sdk/cvat_sdk/configuration.py +++ /dev/null @@ -1,530 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -import copy -import logging -import multiprocessing -import sys -from http import client as http_client - -import urllib3 - -from cvat_sdk.exceptions import ApiValueError - -JSON_SCHEMA_VALIDATION_KEYWORDS = { - "multipleOf", - "maximum", - "exclusiveMaximum", - "minimum", - "exclusiveMinimum", - "maxLength", - "minLength", - "pattern", - "maxItems", - "minItems", -} - - -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param host: Base url - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format - - :Example: - - API Key Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - cookieAuth: # name for the security scheme - type: apiKey - in: cookie - name: JSESSIONID # cookie name - - You can programmatically set the cookie: - - conf = cvat_sdk.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} - ) - - The following cookie will be added to the HTTP request: - Cookie: JSESSIONID abc123 - - HTTP Basic Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - http_basic_auth: - type: http - scheme: basic - - Configure API client with HTTP basic authentication: - - conf = cvat_sdk.Configuration( - username='the-user', - password='the-password', - ) - - """ - - _default = None - - def __init__( - self, - host=None, - api_key=None, - api_key_prefix=None, - access_token=None, - username=None, - password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", - server_index=None, - server_variables=None, - server_operation_index=None, - server_operation_variables=None, - ssl_ca_cert=None, - ): - """Constructor""" - self._base_path = "http://localhost" if host is None else host - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.access_token = access_token - self.api_key = {} - if api_key: - self.api_key = api_key - """dict to store API key(s) - """ - self.api_key_prefix = {} - if api_key_prefix: - self.api_key_prefix = api_key_prefix - """dict to store API prefix (e.g. Bearer) - """ - self.refresh_api_key_hook = None - """function hook to refresh API key if expired - """ - self.username = username - """Username for HTTP basic authentication - """ - self.password = password - """Password for HTTP basic authentication - """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("cvat_sdk") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = "%(asctime)s %(levelname)s %(message)s" - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - self.debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = ssl_ca_cert - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - - 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. - """ - - self.proxy = None - """Proxy URL - """ - self.no_proxy = None - """bypass proxy for host in the no_proxy list. - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = "" - """Safe chars for path_param - """ - self.retries = None - """Adding retries to override urllib3 default value 3 - """ - # Enable client side validation - self.client_side_validation = True - - # Options to pass down to the underlying urllib3 socket - self.socket_options = None - - def __deepcopy__(self, memo): - 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"): - 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, value): - object.__setattr__(self, name, value) - if name == "disabled_client_side_validations": - s = set(filter(None, value.split(","))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError("Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s - - @classmethod - def set_default(cls, default): - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = copy.deepcopy(default) - - @classmethod - def get_default_copy(cls): - """Return new instance of configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration passed by the set_default method. - - :return: The configuration object. - """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in self.logger.items(): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in self.logger.items(): - logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.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 http_client debug - http_client.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier, alias=None): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :param alias: The alternative identifier of apiKey. - :return: The token for api key authentication. - """ - if self.refresh_api_key_hook is not None: - self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - def get_basic_auth_token(self): - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - username = "" - if self.username is not None: - username = self.username - password = "" - if self.password is not None: - password = self.password - return urllib3.util.make_headers(basic_auth=username + ":" + password).get("authorization") - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - auth = {} - if "SignatureAuthentication" in self.api_key: - auth["SignatureAuthentication"] = { - "type": "api_key", - "in": "query", - "key": "sign", - "value": self.get_api_key_with_prefix( - "SignatureAuthentication", - ), - } - if self.username is not None and self.password is not None: - auth["basicAuth"] = { - "type": "basic", - "in": "header", - "key": "Authorization", - "value": self.get_basic_auth_token(), - } - if "cookieAuth" in self.api_key: - auth["cookieAuth"] = { - "type": "api_key", - "in": "cookie", - "key": "sessionid", - "value": self.get_api_key_with_prefix( - "cookieAuth", - ), - } - if "tokenAuth" in self.api_key: - auth["tokenAuth"] = { - "type": "api_key", - "in": "header", - "key": "Authorization", - "value": self.get_api_key_with_prefix( - "tokenAuth", - ), - } - return auth - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return ( - "Python SDK Debug Report:\n" - "OS: {env}\n" - "Python Version: {pyversion}\n" - "Version of the API: alpha (2.0)\n" - "SDK Package Version: 2.0-alpha".format(env=sys.platform, pyversion=sys.version) - ) - - def get_host_settings(self): - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - { - "url": "", - "description": "No description provided", - } - ] - - def get_host_from_settings(self, index, variables=None, servers=None): - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = {} if variables is None else variables - servers = self.get_host_settings() if servers is None else servers - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers)) - ) - - url = server["url"] - - # go through variables and replace placeholders - for variable_name, variable in server.get("variables", {}).items(): - used_value = variables.get(variable_name, variable["default_value"]) - - if "enum_values" in variable and used_value not in variable["enum_values"]: - raise ValueError( - "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format( - variable_name, variables[variable_name], variable["enum_values"] - ) - ) - - url = url.replace("{" + variable_name + "}", used_value) - - return url - - @property - def host(self): - """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value): - """Fix base path.""" - self._base_path = value - self.server_index = None diff --git a/cvat-sdk/cvat_sdk/core/__init__.py b/cvat-sdk/cvat_sdk/core/__init__.py new file mode 100644 index 00000000..1a6103ab --- /dev/null +++ b/cvat-sdk/cvat_sdk/core/__init__.py @@ -0,0 +1,6 @@ +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +from cvat_sdk.core.client import Client, Config, make_client +from cvat_sdk.version import VERSION as __version__ diff --git a/cvat-sdk/cvat_sdk/core/client.py b/cvat-sdk/cvat_sdk/core/client.py new file mode 100644 index 00000000..1518d0c5 --- /dev/null +++ b/cvat-sdk/cvat_sdk/core/client.py @@ -0,0 +1,255 @@ +# Copyright (C) 2020-2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + + +from __future__ import annotations + +import json +import logging +import os.path as osp +import urllib.parse +from time import sleep +from typing import Any, Dict, List, Optional, Sequence, Tuple, Union + +import attrs + +from cvat_sdk.api_client import ApiClient, ApiException, ApiValueError, Configuration, models +from cvat_sdk.core.git import create_git_repo +from cvat_sdk.core.helpers import get_paginated_collection +from cvat_sdk.core.progress import ProgressReporter +from cvat_sdk.core.tasks import TaskProxy +from cvat_sdk.core.types import ResourceType +from cvat_sdk.core.uploading import Uploader +from cvat_sdk.core.utils import assert_status + + +@attrs.define +class Config: + status_check_period: float = 5 + """In seconds""" + + +class Client: + """ + Manages session and configuration. + """ + + # TODO: Locates resources and APIs. + + def __init__( + self, url: str, *, logger: Optional[logging.Logger] = None, config: Optional[Config] = None + ): + # TODO: use requests instead of urllib3 in ApiClient + # TODO: try to autodetect schema + self._api_map = _CVAT_API_V2(url) + self.api = ApiClient(Configuration(host=url)) + self.logger = logger or logging.getLogger(__name__) + self.config = config or Config() + + def __enter__(self): + self.api.__enter__() + return self + + def __exit__(self, exc_type, exc_value, traceback): + return self.api.__exit__(exc_type, exc_value, traceback) + + def close(self): + return self.__exit__(None, None, None) + + def login(self, credentials: Tuple[str, str]): + (auth, _) = self.api.auth_api.create_login( + models.LoginRequest(username=credentials[0], password=credentials[1]) + ) + + assert "sessionid" in self.api.cookies + assert "csrftoken" in self.api.cookies + self.api.set_default_header("Authorization", "Token " + auth.key) + + def create_task( + self, + spec: models.ITaskWriteRequest, + resource_type: ResourceType, + resources: Sequence[str], + *, + data_params: Optional[Dict[str, Any]] = None, + annotation_path: str = "", + annotation_format: str = "CVAT XML 1.1", + status_check_period: int = None, + dataset_repository_url: str = "", + use_lfs: bool = False, + pbar: Optional[ProgressReporter] = None, + ) -> TaskProxy: + """ + Create a new task with the given name and labels JSON and + add the files to it. + + Returns: id of the created task + """ + if status_check_period is None: + status_check_period = self.config.status_check_period + + if getattr(spec, "project_id", None) and getattr(spec, "labels", None): + raise ApiValueError( + "Can't set labels to a task inside a project. " + "Tasks inside a project use project's labels.", + ["labels"], + ) + (task, _) = self.api.tasks_api.create(spec) + self.logger.info("Created task ID: %s NAME: %s", task.id, task.name) + + task = TaskProxy(self, task) + task.upload_data(resource_type, resources, pbar=pbar, params=data_params) + + self.logger.info("Awaiting for task %s creation...", task.id) + status = None + while status != models.RqStatusStateEnum.allowed_values[("value",)]["FINISHED"]: + sleep(status_check_period) + (status, _) = self.api.tasks_api.retrieve_status(task.id) + + self.logger.info( + "Task %s creation status=%s, message=%s", + task.id, + status.state.value, + status.message, + ) + + if status.state.value == models.RqStatusStateEnum.allowed_values[("value",)]["FAILED"]: + raise ApiException(status=status.state.value, reason=status.message) + + status = status.state.value + + if annotation_path: + task.import_annotations(annotation_format, annotation_path, pbar=pbar) + + if dataset_repository_url: + create_git_repo( + self, + task_id=task.id, + repo_url=dataset_repository_url, + status_check_period=status_check_period, + use_lfs=use_lfs, + ) + + task.fetch() + + return task + + def list_tasks( + self, *, return_json: bool = False, **kwargs + ) -> Union[List[TaskProxy], List[Dict[str, Any]]]: + """List all tasks in either basic or JSON format.""" + + results = get_paginated_collection( + endpoint=self.api.tasks_api.list_endpoint, return_json=return_json, **kwargs + ) + + if return_json: + return json.dumps(results) + + return [TaskProxy(self, v) for v in results] + + def retrieve_task(self, task_id: int) -> TaskProxy: + (task, _) = self.api.tasks_api.retrieve(task_id) + return TaskProxy(self, task) + + def delete_tasks(self, task_ids: Sequence[int]): + """ + Delete a list of tasks, ignoring those which don't exist. + """ + + for task_id in task_ids: + (_, response) = self.api.tasks_api.destroy(task_id, _check_status=False) + if 200 <= response.status <= 299: + self.logger.info(f"Task ID {task_id} deleted") + elif response.status == 404: + self.logger.info(f"Task ID {task_id} not found") + else: + self.logger.warning( + f"Failed to delete task ID {task_id}: " + f"{response.msg} (status {response.status})" + ) + + def create_task_from_backup( + self, + filename: str, + *, + status_check_period: int = None, + pbar: Optional[ProgressReporter] = None, + ) -> TaskProxy: + """ + Import a task from a backup file + """ + if status_check_period is None: + status_check_period = self.config.status_check_period + + params = {"filename": osp.basename(filename)} + url = self._api_map.make_endpoint_url(self.api.tasks_api.create_backup_endpoint.path) + uploader = Uploader(self) + response = uploader.upload_file( + url, filename, meta=params, query_params=params, pbar=pbar, logger=self.logger.debug + ) + + rq_id = json.loads(response.data)["rq_id"] + + # check task status + while True: + sleep(status_check_period) + + response = self.api.rest_client.POST( + url, post_params={"rq_id": rq_id}, headers=self.api.get_common_headers() + ) + if response.status == 201: + break + assert_status(202, response) + + task_id = json.loads(response.data)["id"] + self.logger.info(f"Task has been imported sucessfully. Task ID: {task_id}") + + return self.retrieve_task(task_id) + + +class _CVAT_API_V2: + """Build parameterized API URLs""" + + def __init__(self, host, https=False): + if host.startswith("https://"): + https = True + if host.startswith("http://") or host.startswith("https://"): + host = host.replace("http://", "") + host = host.replace("https://", "") + scheme = "https" if https else "http" + self.host = "{}://{}".format(scheme, host) + self.base = self.host + "/api/" + self.git = f"{scheme}://{host}/git/repository/" + + def git_create(self, task_id): + return self.git + f"create/{task_id}" + + def git_check(self, rq_id): + return self.git + f"check/{rq_id}" + + def make_endpoint_url( + self, + path: str, + *, + psub: Optional[Sequence[Any]] = None, + kwsub: Optional[Dict[str, Any]] = None, + query_params: Optional[Dict[str, Any]] = None, + ) -> str: + url = self.host + path + if psub or kwsub: + url = url.format(*(psub or []), **(kwsub or {})) + if query_params: + url += "?" + urllib.parse.urlencode(query_params) + return url + + +def make_client( + host: str, *, port: int = 8080, credentials: Optional[Tuple[int, int]] = None +) -> Client: + client = Client(url=f"{host}:{port}") + if credentials is not None: + client.login(credentials) + return client diff --git a/cvat-sdk/cvat_sdk/core/downloading.py b/cvat-sdk/cvat_sdk/core/downloading.py new file mode 100644 index 00000000..50f5a137 --- /dev/null +++ b/cvat-sdk/cvat_sdk/core/downloading.py @@ -0,0 +1,74 @@ +# Copyright (C) 2020-2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +from __future__ import annotations + +import os +import os.path as osp +from contextlib import closing +from typing import TYPE_CHECKING, Optional + +from cvat_sdk.core.progress import ProgressReporter + +if TYPE_CHECKING: + from cvat_sdk.core.client import Client + + +class Downloader: + def __init__(self, client: Client): + self.client = client + + def download_file( + self, + url: str, + output_path: str, + *, + timeout: int = 60, + pbar: Optional[ProgressReporter] = None, + ) -> None: + """ + Downloads the file from url into a temporary file, then renames it + to the requested name. + """ + + CHUNK_SIZE = 10 * 2**20 + + assert not osp.exists(output_path) + + tmp_path = output_path + ".tmp" + if osp.exists(tmp_path): + raise FileExistsError(f"Can't write temporary file '{tmp_path}' - file exists") + + response = self.client.api.rest_client.GET( + url, + _request_timeout=timeout, + headers=self.client.api.get_common_headers(), + _parse_response=False, + ) + with closing(response): + try: + file_size = int(response.getheader("Content-Length", 0)) + except ValueError: + file_size = None + + try: + with open(tmp_path, "wb") as fd: + if pbar is not None: + pbar.start(file_size, desc="Downloading") + + while True: + chunk = response.read(amt=CHUNK_SIZE, decode_content=False) + if not chunk: + break + + if pbar is not None: + pbar.advance(len(chunk)) + + fd.write(chunk) + + os.rename(tmp_path, output_path) + except: + os.unlink(tmp_path) + raise diff --git a/cvat-sdk/cvat_sdk/core/git.py b/cvat-sdk/cvat_sdk/core/git.py new file mode 100644 index 00000000..828d3127 --- /dev/null +++ b/cvat-sdk/cvat_sdk/core/git.py @@ -0,0 +1,60 @@ +# Copyright (C) 2020-2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +from __future__ import annotations + +import json +from time import sleep +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from cvat_sdk.core.client import Client + + +def create_git_repo( + client: Client, + *, + task_id: int, + repo_url: str, + status_check_period: int = None, + use_lfs: bool = True, +): + if status_check_period is None: + status_check_period = client.config.status_check_period + + common_headers = client.api.get_common_headers() + + response = client.api.rest_client.POST( + client._api_map.git_create(task_id), + post_params={"path": repo_url, "lfs": use_lfs, "tid": task_id}, + headers=common_headers, + ) + response_json = json.loads(response) + rq_id = response_json["rq_id"] + client.logger.info(f"Create RQ ID: {rq_id}") + + client.logger.debug("Awaiting a dataset repository to be created for the task %s...", task_id) + check_url = client._api_map.git_check(rq_id) + status = None + while status != "finished": + sleep(status_check_period) + response = client.api.rest_client.GET(check_url, headers=common_headers) + response_json = json.loads(response.data) + status = response_json["status"] + if status == "failed" or status == "unknown": + client.logger.error( + "Dataset repository creation request for task %s failed" "with status %s.", + task_id, + status, + ) + break + + client.logger.debug( + "Awaiting a dataset repository to be created for the task %s. Response status: %s", + task_id, + status, + ) + + client.logger.debug("Dataset repository creation completed with status: %s.", status) diff --git a/cvat-sdk/cvat_sdk/core/helpers.py b/cvat-sdk/cvat_sdk/core/helpers.py new file mode 100644 index 00000000..8b8120c8 --- /dev/null +++ b/cvat-sdk/cvat_sdk/core/helpers.py @@ -0,0 +1,88 @@ +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +from __future__ import annotations + +import io +import json +from typing import Any, Dict, List, Optional, Union + +import tqdm + +from cvat_sdk.api_client.api_client import Endpoint +from cvat_sdk.core.progress import ProgressReporter +from cvat_sdk.core.utils import assert_status + + +def get_paginated_collection( + endpoint: Endpoint, *, return_json: bool = False, **kwargs +) -> Union[List, List[Dict[str, Any]]]: + """ + Accumulates results from all the pages + """ + + results = [] + page = 1 + while True: + (page_contents, response) = endpoint.call_with_http_info(**kwargs, page=page) + assert_status(200, response) + + if return_json: + results.extend(json.loads(response.data).get("results", [])) + else: + results.extend(page_contents.results) + + if not page_contents.next: + break + page += 1 + + return results + + +class TqdmProgressReporter(ProgressReporter): + def __init__(self, instance: tqdm.tqdm) -> None: + super().__init__() + self.tqdm = instance + + @property + def period(self) -> float: + return 0 + + def start(self, total: int, *, desc: Optional[str] = None): + self.tqdm.reset(total) + self.tqdm.set_description_str(desc) + + def report_status(self, progress: int): + self.tqdm.update(progress - self.tqdm.n) + + def advance(self, delta: int): + self.tqdm.update(delta) + + +class StreamWithProgress: + def __init__(self, stream: io.RawIOBase, pbar: ProgressReporter, length: Optional[int] = None): + self.stream = stream + self.pbar = pbar + + if hasattr(stream, "__len__"): + length = len(stream) + + self.length = length + pbar.start(length) + + def read(self, size=-1): + chunk = self.stream.read(size) + if chunk is not None: + self.pbar.advance(len(chunk)) + return chunk + + def __len__(self): + return self.length + + def seek(self, pos, start=0): + self.stream.seek(pos, start) + self.pbar.report_status(pos) + + def tell(self): + return self.stream.tell() diff --git a/cvat-sdk/cvat_sdk/core/progress.py b/cvat-sdk/cvat_sdk/core/progress.py new file mode 100644 index 00000000..f620e13c --- /dev/null +++ b/cvat-sdk/cvat_sdk/core/progress.py @@ -0,0 +1,123 @@ +# Copyright (C) 2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +from __future__ import annotations + +import math +from typing import Iterable, Optional, Tuple, TypeVar + +T = TypeVar("T") + + +class ProgressReporter: + """ + Only one set of methods must be called: + - start - report_status / advance - finish + - iter + - split + + This class is supposed to manage the state of children progress bars + and release of their resources, if necessary. + """ + + @property + def period(self) -> float: + """ + Returns reporting period. + + For example, 0.1 would mean every 10%. + """ + raise NotImplementedError + + def start(self, total: int, *, desc: Optional[str] = None): + """Initializes the progress bar""" + raise NotImplementedError + + def report_status(self, progress: int): + """Updates the progress bar""" + raise NotImplementedError + + def advance(self, delta: int): + """Updates the progress bar""" + raise NotImplementedError + + def finish(self): + """Finishes the progress bar""" + pass # pylint: disable=unnecessary-pass + + def iter( + self, + iterable: Iterable[T], + *, + total: Optional[int] = None, + desc: Optional[str] = None, + ) -> Iterable[T]: + """ + Traverses the iterable and reports progress simultaneously. + + Starts and finishes the progress bar automatically. + + Args: + iterable: An iterable to be traversed + total: The expected number of iterations. If not provided, will + try to use iterable.__len__. + desc: The status message + + Returns: + An iterable over elements of the input sequence + """ + + if total is None and hasattr(iterable, "__len__"): + total = len(iterable) + + self.start(total, desc=desc) + + if total: + display_step = math.ceil(total * self.period) + + for i, elem in enumerate(iterable): + if not total or i % display_step == 0: + self.report_status(i) + + yield elem + + self.finish() + + def split(self, count: int) -> Tuple[ProgressReporter, ...]: + """ + Splits the progress bar into few independent parts. + In case of 0 must return an empty tuple. + + This class is supposed to manage the state of children progress bars + and release of their resources, if necessary. + """ + raise NotImplementedError + + +class NullProgressReporter(ProgressReporter): + @property + def period(self) -> float: + return 0 + + def start(self, total: int, *, desc: Optional[str] = None): + pass + + def report_status(self, progress: int): + pass + + def advance(self, delta: int): + pass + + def iter( + self, + iterable: Iterable[T], + *, + total: Optional[int] = None, + desc: Optional[str] = None, + ) -> Iterable[T]: + yield from iterable + + def split(self, count: int) -> Tuple[ProgressReporter]: + return (self,) * count diff --git a/cvat-sdk/cvat_sdk/core/schema.py b/cvat-sdk/cvat_sdk/core/schema.py new file mode 100644 index 00000000..fb6ebf1b --- /dev/null +++ b/cvat-sdk/cvat_sdk/core/schema.py @@ -0,0 +1,28 @@ +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + + +from typing import Optional + +import requests + + +def detect_schema(url: str) -> Optional[str]: + """ + Attempts to detect URL schema (http or https) if none provided in the URL. + """ + + if url.startswith("http://") or url.startswith("https://"): + return url + + for schema in ["https://", "http://"]: + try: + v = schema + url + response = requests.request("GET", v) + response.raise_for_status() + return v + except requests.HTTPError: + pass + + return None diff --git a/cvat-sdk/cvat_sdk/core/tasks.py b/cvat-sdk/cvat_sdk/core/tasks.py new file mode 100644 index 00000000..33e6b965 --- /dev/null +++ b/cvat-sdk/cvat_sdk/core/tasks.py @@ -0,0 +1,308 @@ +# Copyright (C) 2020-2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +from __future__ import annotations + +import io +import mimetypes +import os +import os.path as osp +from abc import ABC, abstractmethod +from io import BytesIO +from time import sleep +from typing import TYPE_CHECKING, Any, Dict, List, Optional, Sequence + +from PIL import Image + +from cvat_sdk import models +from cvat_sdk.api_client.model_utils import OpenApiModel +from cvat_sdk.core.downloading import Downloader +from cvat_sdk.core.progress import ProgressReporter +from cvat_sdk.core.types import ResourceType +from cvat_sdk.core.uploading import Uploader +from cvat_sdk.core.utils import filter_dict + +if TYPE_CHECKING: + from cvat_sdk.core.client import Client + + +class ModelProxy(ABC): + _client: Client + _model: OpenApiModel + + def __init__(self, client: Client, model: OpenApiModel) -> None: + self.__dict__["_client"] = client + self.__dict__["_model"] = model + + def __getattr__(self, __name: str) -> Any: + return self._model[__name] + + def __setattr__(self, __name: str, __value: Any) -> None: + if __name in self.__dict__: + self.__dict__[__name] = __value + else: + self._model[__name] = __value + + @abstractmethod + def fetch(self, force: bool = False): + """Fetches model data from the server""" + ... + + @abstractmethod + def commit(self, force: bool = False): + """Commits local changes to the server""" + ... + + def sync(self): + """Pulls server state and commits local model changes""" + raise NotImplementedError + + @abstractmethod + def update(self, **kwargs): + """Updates multiple fields at once""" + ... + + +class TaskProxy(ModelProxy, models.ITaskRead): + def __init__(self, client: Client, task: models.TaskRead): + ModelProxy.__init__(self, client=client, model=task) + + def remove(self): + self._client.api.tasks_api.destroy(self.id) + + def upload_data( + self, + resource_type: ResourceType, + resources: Sequence[str], + *, + pbar: Optional[ProgressReporter] = None, + params: Optional[Dict[str, Any]] = None, + ) -> None: + """ + Add local, remote, or shared files to an existing task. + """ + client = self._client + task_id = self.id + + params = params or {} + + data = {} + if resource_type is ResourceType.LOCAL: + pass # handled later + elif resource_type is ResourceType.REMOTE: + data = {f"remote_files[{i}]": f for i, f in enumerate(resources)} + elif resource_type is ResourceType.SHARE: + data = {f"server_files[{i}]": f for i, f in enumerate(resources)} + + data["image_quality"] = 70 + data.update( + filter_dict( + params, + keep=[ + "chunk_size", + "copy_data", + "image_quality", + "sorting_method", + "start_frame", + "stop_frame", + "use_cache", + "use_zip_chunks", + ], + ) + ) + if params.get("frame_step") is not None: + data["frame_filter"] = f"step={params.get('frame_step')}" + + if resource_type in [ResourceType.REMOTE, ResourceType.SHARE]: + client.api.tasks_api.create_data( + task_id, + data_request=models.DataRequest(**data), + _content_type="multipart/form-data", + ) + elif resource_type == ResourceType.LOCAL: + url = client._api_map.make_endpoint_url( + client.api.tasks_api.create_data_endpoint.path, kwsub={"id": task_id} + ) + + uploader = Uploader(client) + uploader.upload_files(url, resources, pbar=pbar, **data) + + def import_annotations( + self, + format_name: str, + filename: str, + *, + status_check_period: int = None, + pbar: Optional[ProgressReporter] = None, + ): + """ + Upload annotations for a task in the specified format + (e.g. 'YOLO ZIP 1.0'). + """ + client = self._client + if status_check_period is None: + status_check_period = client.config.status_check_period + + task_id = self.id + + url = client._api_map.make_endpoint_url( + client.api.tasks_api.create_annotations_endpoint.path, + kwsub={"id": task_id}, + ) + params = {"format": format_name, "filename": osp.basename(filename)} + + uploader = Uploader(client) + uploader.upload_file( + url, filename, pbar=pbar, query_params=params, meta={"filename": params["filename"]} + ) + + while True: + response = client.api.rest_client.POST( + url, headers=client.api.get_common_headers(), query_params=params + ) + if response.status == 201: + break + + sleep(status_check_period) + + client.logger.info( + f"Upload job for Task ID {task_id} with annotation file {filename} finished" + ) + + def retrieve_frame( + self, + frame_id: int, + *, + quality: Optional[str] = None, + ) -> io.RawIOBase: + client = self._client + task_id = self.id + + (_, response) = client.api.tasks_api.retrieve_data(task_id, frame_id, quality, type="frame") + + return BytesIO(response.data) + + def download_frames( + self, + frame_ids: Sequence[int], + *, + outdir: str = "", + quality: str = "original", + filename_pattern: str = "task_{task_id}_frame_{frame_id:06d}{frame_ext}", + ) -> Optional[List[Image.Image]]: + """ + Download the requested frame numbers for a task and save images as + outdir/filename_pattern + """ + # TODO: add arg descriptions in schema + task_id = self.id + + os.makedirs(outdir, exist_ok=True) + + for frame_id in frame_ids: + frame_bytes = self.retrieve_frame(frame_id, quality=quality) + + im = Image.open(frame_bytes) + mime_type = im.get_format_mimetype() or "image/jpg" + im_ext = mimetypes.guess_extension(mime_type) + + # FIXME It is better to use meta information from the server + # to determine the extension + # replace '.jpe' or '.jpeg' with a more used '.jpg' + if im_ext in (".jpe", ".jpeg", None): + im_ext = ".jpg" + + outfile = filename_pattern.format(task_id=task_id, frame_id=frame_id, frame_ext=im_ext) + im.save(osp.join(outdir, outfile)) + + def export_dataset( + self, + format_name: str, + filename: str, + *, + pbar: Optional[ProgressReporter] = None, + status_check_period: int = None, + include_images: bool = True, + ) -> None: + """ + Download annotations for a task in the specified format (e.g. 'YOLO ZIP 1.0'). + """ + client = self._client + if status_check_period is None: + status_check_period = client.config.status_check_period + + task_id = self.id + + params = {"filename": self.name, "format": format_name} + if include_images: + endpoint = client.api.tasks_api.retrieve_dataset_endpoint + else: + endpoint = client.api.tasks_api.retrieve_annotations_endpoint + + client.logger.info("Waiting for the server to prepare the file...") + while True: + (_, response) = endpoint.call_with_http_info(id=task_id, **params) + client.logger.debug("STATUS {}".format(response.status)) + if response.status == 201: + break + sleep(status_check_period) + + params["action"] = "download" + url = client._api_map.make_endpoint_url( + endpoint.path, kwsub={"id": task_id}, query_params=params + ) + downloader = Downloader(client) + downloader.download_file(url, output_path=filename, pbar=pbar) + + client.logger.info(f"Dataset has been exported to {filename}") + + def download_backup( + self, + filename: str, + *, + status_check_period: int = None, + pbar: Optional[ProgressReporter] = None, + ): + """ + Download a task backup + """ + client = self._client + if status_check_period is None: + status_check_period = client.config.status_check_period + + task_id = self.id + + endpoint = client.api.tasks_api.retrieve_backup_endpoint + client.logger.info("Waiting for the server to prepare the file...") + while True: + (_, response) = endpoint.call_with_http_info(id=task_id) + client.logger.debug("STATUS {}".format(response.status)) + if response.status == 201: + break + sleep(status_check_period) + + url = client._api_map.make_endpoint_url( + endpoint.path, kwsub={"id": task_id}, query_params={"action": "download"} + ) + downloader = Downloader(client) + downloader.download_file(url, output_path=filename, pbar=pbar) + + client.logger.info( + f"Task {task_id} has been exported sucessfully to {osp.abspath(filename)}" + ) + + def fetch(self, force: bool = False): + # TODO: implement revision checking + model, _ = self._client.api.tasks_api.retrieve(self.id) + self._model = model + + def commit(self, force: bool = False): + return super().commit(force) + + def update(self, **kwargs): + return super().update(**kwargs) + + def __str__(self) -> str: + return str(self._model) diff --git a/cvat-sdk/cvat_sdk/core/types.py b/cvat-sdk/cvat_sdk/core/types.py new file mode 100644 index 00000000..f1d8d89e --- /dev/null +++ b/cvat-sdk/cvat_sdk/core/types.py @@ -0,0 +1,18 @@ +# Copyright (C) 2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +from enum import Enum + + +class ResourceType(Enum): + LOCAL = 0 + SHARE = 1 + REMOTE = 2 + + def __str__(self): + return self.name.lower() + + def __repr__(self): + return str(self) diff --git a/cvat-sdk/cvat_sdk/core/uploading.py b/cvat-sdk/cvat_sdk/core/uploading.py new file mode 100644 index 00000000..9b8c0b72 --- /dev/null +++ b/cvat-sdk/cvat_sdk/core/uploading.py @@ -0,0 +1,303 @@ +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +from __future__ import annotations + +import os +import os.path as osp +from contextlib import ExitStack, closing +from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple + +import requests +import urllib3 + +from cvat_sdk.api_client import ApiClient +from cvat_sdk.api_client.rest import RESTClientObject +from cvat_sdk.core.helpers import StreamWithProgress +from cvat_sdk.core.progress import ProgressReporter +from cvat_sdk.core.utils import assert_status + +if TYPE_CHECKING: + from cvat_sdk.core.client import Client + +MAX_REQUEST_SIZE = 100 * 2**20 + + +class Uploader: + def __init__(self, client: Client): + self.client = client + + def upload_files( + self, + url: str, + resources: List[str], + *, + pbar: Optional[ProgressReporter] = None, + **kwargs, + ): + bulk_file_groups, separate_files, total_size = self._split_files_by_requests(resources) + + if pbar is not None: + pbar.start(total_size, desc="Uploading data") + + self._tus_start_upload(url) + + for group, group_size in bulk_file_groups: + with ExitStack() as es: + files = {} + for i, filename in enumerate(group): + files[f"client_files[{i}]"] = ( + filename, + es.enter_context(closing(open(filename, "rb"))).read(), + ) + response = self.client.api.rest_client.POST( + url, + post_params=dict(**kwargs, **files), + headers={ + "Content-Type": "multipart/form-data", + "Upload-Multiple": "", + **self.client.api.get_common_headers(), + }, + ) + assert_status(200, response) + + if pbar is not None: + pbar.advance(group_size) + + for filename in separate_files: + # TODO: check if basename produces invalid paths here, can lead to overwriting + self._upload_file_data_with_tus( + url, + filename, + meta={"filename": osp.basename(filename)}, + pbar=pbar, + logger=self.client.logger.debug, + ) + + self._tus_finish_upload(url, fields=kwargs) + + def upload_file( + self, + url: str, + filename: str, + *, + meta: Dict[str, Any], + query_params: Dict[str, Any] = None, + fields: Optional[Dict[str, Any]] = None, + pbar: Optional[ProgressReporter] = None, + logger=None, + ) -> urllib3.HTTPResponse: + """ + Annotation uploads: + - have "filename" meta field in chunks + - have "filename" and "format" query params in the "Upload-Finished" request + + + Data (image, video, ...) uploads: + - have "filename" meta field in chunks + - have a number of fields in the "Upload-Finished" request + + + Backup uploads: + - have "filename" meta field in chunks + - have "filename" query params in the "Upload-Finished" request + + OR + - have "task_file" field in the POST request data (a file) + + meta['filename'] is always required. It must be set to the "visible" file name or path + + Returns: + response of the last request (the "Upload-Finished" one) + """ + # "CVAT-TUS" protocol has 2 extra messages + # query params are used only in the extra messages + assert meta["filename"] + + self._tus_start_upload(url, query_params=query_params) + self._upload_file_data_with_tus( + url=url, filename=filename, meta=meta, pbar=pbar, logger=logger + ) + return self._tus_finish_upload(url, query_params=query_params, fields=fields) + + def _split_files_by_requests( + self, filenames: List[str] + ) -> Tuple[List[Tuple[List[str], int]], List[str], int]: + bulk_files: Dict[str, int] = {} + separate_files: Dict[str, int] = {} + + # sort by size + for filename in filenames: + filename = os.path.abspath(filename) + file_size = os.stat(filename).st_size + if MAX_REQUEST_SIZE < file_size: + separate_files[filename] = file_size + else: + bulk_files[filename] = file_size + + total_size = sum(bulk_files.values()) + sum(separate_files.values()) + + # group small files by requests + bulk_file_groups: List[Tuple[List[str], int]] = [] + current_group_size: int = 0 + current_group: List[str] = [] + for filename, file_size in bulk_files.items(): + if MAX_REQUEST_SIZE < current_group_size + file_size: + bulk_file_groups.append((current_group, current_group_size)) + current_group_size = 0 + current_group = [] + + current_group.append(filename) + current_group_size += file_size + if current_group: + bulk_file_groups.append((current_group, current_group_size)) + + return bulk_file_groups, separate_files, total_size + + @staticmethod + def _make_tus_uploader(api_client: ApiClient, url: str, **kwargs): + import tusclient.uploader as tus_uploader + from tusclient.client import TusClient, Uploader + from tusclient.request import TusRequest, TusUploadFailed + + class RestClientAdapter: + # Provides requests.Session-like interface for REST client + # only patch is called in the tus client + + def __init__(self, rest_client: RESTClientObject): + self.rest_client = rest_client + + def _request(self, method, url, data=None, json=None, **kwargs): + raw = self.rest_client.request( + method=method, + url=url, + headers=kwargs.get("headers"), + query_params=kwargs.get("params"), + post_params=json, + body=data, + _parse_response=False, + _request_timeout=kwargs.get("timeout"), + _check_status=False, + ) + + result = requests.Response() + result._content = raw.data + result.raw = raw + result.headers.update(raw.headers) + result.status_code = raw.status + result.reason = raw.msg + return result + + def patch(self, *args, **kwargs): + return self._request("PATCH", *args, **kwargs) + + class MyTusUploader(Uploader): + # Adjusts the library code for CVAT server + # Allows to reuse session + + def __init__(self, *_args, api_client: ApiClient, **_kwargs): + self._api_client = api_client + super().__init__(*_args, **_kwargs) + + def _do_request(self): + self.request = TusRequest(self) + self.request.handle = RestClientAdapter(self._api_client.rest_client) + try: + self.request.perform() + self.verify_upload() + except TusUploadFailed as error: + self._retry_or_cry(error) + + @tus_uploader._catch_requests_error + def create_url(self): + """ + Return upload url. + + Makes request to tus server to create a new upload url for the required file upload. + """ + headers = self.headers + headers["upload-length"] = str(self.file_size) + headers["upload-metadata"] = ",".join(self.encode_metadata()) + resp = self._api_client.rest_client.POST(self.client.url, headers=headers) + url = resp.headers.get("location") + if url is None: + msg = "Attempt to retrieve create file url with status {}".format( + resp.status_code + ) + raise tus_uploader.TusCommunicationError(msg, resp.status_code, resp.content) + return tus_uploader.urljoin(self.client.url, url) + + @tus_uploader._catch_requests_error + def get_offset(self): + """ + Return offset from tus server. + + This is different from the instance attribute 'offset' because this makes an + http request to the tus server to retrieve the offset. + """ + # FIXME: traefik changes HEAD to GET for some reason, and it breaks the protocol + + # Assume we are starting from scratch. This effectively disallows us to resume + # old file uploading + return 0 + + # resp = self._api_client.rest_client.HEAD(self.url, headers=self.headers) + # offset = resp.headers.get("upload-offset") + # if offset is None: + # msg = "Attempt to retrieve offset fails with status {}".format(resp.status_code) + # raise tus_uploader.TusCommunicationError(msg, resp.status_code, resp.content) + # return int(offset) + + # Add headers required by CVAT server + headers = {} + headers["Origin"] = api_client.configuration.host + headers.update(api_client.get_common_headers()) + + client = TusClient(url, headers=headers) + + return MyTusUploader(client=client, api_client=api_client, **kwargs) + + def _upload_file_data_with_tus(self, url, filename, *, meta=None, pbar=None, logger=None): + CHUNK_SIZE = 10 * 2**20 + + file_size = os.stat(filename).st_size + + with open(filename, "rb") as input_file: + if pbar is not None: + input_file = StreamWithProgress(input_file, pbar, length=file_size) + + tus_uploader = self._make_tus_uploader( + self.client.api, + url=url.rstrip("/") + "/", + metadata=meta, + file_stream=input_file, + chunk_size=CHUNK_SIZE, + log_func=logger, + ) + tus_uploader.upload() + + def _tus_start_upload(self, url, *, query_params=None): + response = self.client.api.rest_client.POST( + url, + query_params=query_params, + headers={ + "Upload-Start": "", + **self.client.api.get_common_headers(), + }, + ) + assert_status(202, response) + return response + + def _tus_finish_upload(self, url, *, query_params=None, fields=None): + response = self.client.api.rest_client.POST( + url, + headers={ + "Upload-Finish": "", + **self.client.api.get_common_headers(), + }, + query_params=query_params, + post_params=fields, + ) + assert_status(202, response) + return response diff --git a/cvat-sdk/cvat_sdk/core/utils.py b/cvat-sdk/cvat_sdk/core/utils.py new file mode 100644 index 00000000..d931e2f8 --- /dev/null +++ b/cvat-sdk/cvat_sdk/core/utils.py @@ -0,0 +1,21 @@ +# Copyright (C) 2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +from __future__ import annotations + +from typing import Any, Dict, Sequence + +import urllib3 + + +def assert_status(code: int, response: urllib3.HTTPResponse) -> None: + if response.status != code: + raise Exception(f"Unexpected status code received {response.status}") + + +def filter_dict( + d: Dict[str, Any], *, keep: Sequence[str] = None, drop: Sequence[str] = None +) -> Dict[str, Any]: + return {k: v for k, v in d.items() if (not keep or k in keep) and (not drop or k not in drop)} diff --git a/cvat-sdk/cvat_sdk/exceptions.py b/cvat-sdk/cvat_sdk/exceptions.py index 99566bed..2901582f 100644 --- a/cvat-sdk/cvat_sdk/exceptions.py +++ b/cvat-sdk/cvat_sdk/exceptions.py @@ -2,152 +2,12 @@ # # SPDX-License-Identifier: MIT -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -class OpenApiException(Exception): - """The base exception class for all OpenAPIExceptions""" - - -class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None): - """Raises an exception for TypeErrors - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) - - -class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ - - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) - - -class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): - """ - Raised when an attribute reference or assignment fails. - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) - - -class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) - - -class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None): - if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data - self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None - - def __str__(self): - """Custom error messages for exception""" - error_message = "Status Code: {0}\n" "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format(self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - - -class NotFoundException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) - - -class UnauthorizedException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) - - -class ForbiddenException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) - - -class ServiceException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) - - -def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, int): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result +# pylint: disable=unused-import +from cvat_sdk.api_client.exceptions import ( + ApiAttributeError, + ApiException, + ApiKeyError, + ApiTypeError, + ApiValueError, + OpenApiException, +) diff --git a/cvat-sdk/cvat_sdk/model/__init__.py b/cvat-sdk/cvat_sdk/model/__init__.py deleted file mode 100644 index 7984b6ca..00000000 --- a/cvat-sdk/cvat_sdk/model/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# we can not import model classes here because that would create a circular -# reference which would not work in python2 -# do not import all models into this module because that uses a lot of memory and stack frames -# if you need the ability to import all models from one package, import them with -# from cvat_sdk.models import ModelA, ModelB diff --git a/cvat-sdk/cvat_sdk/model/about.py b/cvat-sdk/cvat_sdk/model/about.py deleted file mode 100644 index 5265b1f6..00000000 --- a/cvat-sdk/cvat_sdk/model/about.py +++ /dev/null @@ -1,341 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class About(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - name (str): - - description (str): - - version (str): - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("name",): { - "max_length": 128, - }, - ("description",): { - "max_length": 2048, - }, - ("version",): { - "max_length": 64, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "name": (str,), # noqa: E501 - "description": (str,), # noqa: E501 - "version": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - name: str # noqa: E501 - """ - """ - - description: str # noqa: E501 - """ - """ - - version: str # noqa: E501 - """ - """ - - attribute_map = { - "name": "name", # noqa: E501 - "description": "description", # noqa: E501 - "version": "version", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, description, version, *args, **kwargs): # noqa: E501 - """About - a model defined in OpenAPI - - Args: - name (str): - description (str): - version (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.description = description - self.version = version - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, name, description, version, *args, **kwargs): # noqa: E501 - """About - a model defined in OpenAPI - - Args: - name (str): - description (str): - version (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.description = description - self.version = version - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/annotation_file_request.py b/cvat-sdk/cvat_sdk/model/annotation_file_request.py deleted file mode 100644 index 11bb6a15..00000000 --- a/cvat-sdk/cvat_sdk/model/annotation_file_request.py +++ /dev/null @@ -1,307 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class AnnotationFileRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - annotation_file (file_type): - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "annotation_file": (file_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - annotation_file: file_type # noqa: E501 - """ - """ - - attribute_map = { - "annotation_file": "annotation_file", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, annotation_file, *args, **kwargs): # noqa: E501 - """AnnotationFileRequest - a model defined in OpenAPI - - Args: - annotation_file (file_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.annotation_file = annotation_file - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, annotation_file, *args, **kwargs): # noqa: E501 - """AnnotationFileRequest - a model defined in OpenAPI - - Args: - annotation_file (file_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.annotation_file = annotation_file - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/attribute.py b/cvat-sdk/cvat_sdk/model/attribute.py deleted file mode 100644 index 05fd6dca..00000000 --- a/cvat-sdk/cvat_sdk/model/attribute.py +++ /dev/null @@ -1,388 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.input_type_enum import InputTypeEnum - - globals()["InputTypeEnum"] = InputTypeEnum - - -class Attribute(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - name (str): - - mutable (bool): - - input_type (InputTypeEnum): - - default_value (str): - - values ([str]): - - id (int): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("name",): { - "max_length": 64, - }, - ("default_value",): { - "max_length": 128, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "name": (str,), # noqa: E501 - "mutable": (bool,), # noqa: E501 - "input_type": (InputTypeEnum,), # noqa: E501 - "default_value": (str,), # noqa: E501 - "values": ([str],), # noqa: E501 - "id": (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - id: int # noqa: E501 - """ - [optional] - """ - - name: str # noqa: E501 - """ - """ - - mutable: bool # noqa: E501 - """ - """ - - input_type: InputTypeEnum # noqa: E501 - """ - """ - - default_value: str # noqa: E501 - """ - """ - - values: typing.List[str] # noqa: E501 - """ - [str] - """ - - attribute_map = { - "name": "name", # noqa: E501 - "mutable": "mutable", # noqa: E501 - "input_type": "input_type", # noqa: E501 - "default_value": "default_value", # noqa: E501 - "values": "values", # noqa: E501 - "id": "id", # noqa: E501 - } - - read_only_vars = { - "id", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data( - cls, name, mutable, input_type, default_value, values, *args, **kwargs - ): # noqa: E501 - """Attribute - a model defined in OpenAPI - - Args: - name (str): - mutable (bool): - input_type (InputTypeEnum): - default_value (str): - values ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.mutable = mutable - self.input_type = input_type - self.default_value = default_value - self.values = values - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__( - self, name, mutable, input_type, default_value, values, *args, **kwargs - ): # noqa: E501 - """Attribute - a model defined in OpenAPI - - Args: - name (str): - mutable (bool): - input_type (InputTypeEnum): - default_value (str): - values ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.mutable = mutable - self.input_type = input_type - self.default_value = default_value - self.values = values - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/attribute_request.py b/cvat-sdk/cvat_sdk/model/attribute_request.py deleted file mode 100644 index 4a552c2c..00000000 --- a/cvat-sdk/cvat_sdk/model/attribute_request.py +++ /dev/null @@ -1,377 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.input_type_enum import InputTypeEnum - - globals()["InputTypeEnum"] = InputTypeEnum - - -class AttributeRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - name (str): - - mutable (bool): - - input_type (InputTypeEnum): - - default_value (str): - - values ([str]): - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("name",): { - "max_length": 64, - "min_length": 1, - }, - ("default_value",): { - "max_length": 128, - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "name": (str,), # noqa: E501 - "mutable": (bool,), # noqa: E501 - "input_type": (InputTypeEnum,), # noqa: E501 - "default_value": (str,), # noqa: E501 - "values": ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - name: str # noqa: E501 - """ - """ - - mutable: bool # noqa: E501 - """ - """ - - input_type: InputTypeEnum # noqa: E501 - """ - """ - - default_value: str # noqa: E501 - """ - """ - - values: typing.List[str] # noqa: E501 - """ - [str] - """ - - attribute_map = { - "name": "name", # noqa: E501 - "mutable": "mutable", # noqa: E501 - "input_type": "input_type", # noqa: E501 - "default_value": "default_value", # noqa: E501 - "values": "values", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data( - cls, name, mutable, input_type, default_value, values, *args, **kwargs - ): # noqa: E501 - """AttributeRequest - a model defined in OpenAPI - - Args: - name (str): - mutable (bool): - input_type (InputTypeEnum): - default_value (str): - values ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.mutable = mutable - self.input_type = input_type - self.default_value = default_value - self.values = values - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__( - self, name, mutable, input_type, default_value, values, *args, **kwargs - ): # noqa: E501 - """AttributeRequest - a model defined in OpenAPI - - Args: - name (str): - mutable (bool): - input_type (InputTypeEnum): - default_value (str): - values ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.mutable = mutable - self.input_type = input_type - self.default_value = default_value - self.values = values - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/attribute_val.py b/cvat-sdk/cvat_sdk/model/attribute_val.py deleted file mode 100644 index c4227cfb..00000000 --- a/cvat-sdk/cvat_sdk/model/attribute_val.py +++ /dev/null @@ -1,323 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class AttributeVal(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - spec_id (int): - - value (str): - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("value",): { - "max_length": 4096, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "spec_id": (int,), # noqa: E501 - "value": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - spec_id: int # noqa: E501 - """ - """ - - value: str # noqa: E501 - """ - """ - - attribute_map = { - "spec_id": "spec_id", # noqa: E501 - "value": "value", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, spec_id, value, *args, **kwargs): # noqa: E501 - """AttributeVal - a model defined in OpenAPI - - Args: - spec_id (int): - value (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.spec_id = spec_id - self.value = value - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, spec_id, value, *args, **kwargs): # noqa: E501 - """AttributeVal - a model defined in OpenAPI - - Args: - spec_id (int): - value (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.spec_id = spec_id - self.value = value - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/basic_user.py b/cvat-sdk/cvat_sdk/model/basic_user.py deleted file mode 100644 index 988b0e23..00000000 --- a/cvat-sdk/cvat_sdk/model/basic_user.py +++ /dev/null @@ -1,368 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class BasicUser(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - username (str): Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - - url (str): [optional] # noqa: E501 - - id (int): [optional] # noqa: E501 - - first_name (str): [optional] # noqa: E501 - - last_name (str): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("username",): { - "max_length": 150, - "regex": { - "pattern": r"^[\w.@+-]+$", # noqa: E501 - }, - }, - ("first_name",): { - "max_length": 150, - }, - ("last_name",): { - "max_length": 150, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "username": (str,), # noqa: E501 - "url": (str,), # noqa: E501 - "id": (int,), # noqa: E501 - "first_name": (str,), # noqa: E501 - "last_name": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - url: str # noqa: E501 - """ - [optional] - """ - - id: int # noqa: E501 - """ - [optional] - """ - - username: str # noqa: E501 - """ - Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.. - """ - - first_name: str # noqa: E501 - """ - [optional] - """ - - last_name: str # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "username": "username", # noqa: E501 - "url": "url", # noqa: E501 - "id": "id", # noqa: E501 - "first_name": "first_name", # noqa: E501 - "last_name": "last_name", # noqa: E501 - } - - read_only_vars = { - "url", # noqa: E501 - "id", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, username, *args, **kwargs): # noqa: E501 - """BasicUser - a model defined in OpenAPI - - Args: - username (str): Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.username = username - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, username, *args, **kwargs): # noqa: E501 - """BasicUser - a model defined in OpenAPI - - Args: - username (str): Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.username = username - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/basic_user_request.py b/cvat-sdk/cvat_sdk/model/basic_user_request.py deleted file mode 100644 index 20b22b26..00000000 --- a/cvat-sdk/cvat_sdk/model/basic_user_request.py +++ /dev/null @@ -1,344 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class BasicUserRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - username (str): Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - - first_name (str): [optional] # noqa: E501 - - last_name (str): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("username",): { - "max_length": 150, - "min_length": 1, - "regex": { - "pattern": r"^[\w.@+-]+$", # noqa: E501 - }, - }, - ("first_name",): { - "max_length": 150, - }, - ("last_name",): { - "max_length": 150, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "username": (str,), # noqa: E501 - "first_name": (str,), # noqa: E501 - "last_name": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - username: str # noqa: E501 - """ - Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.. - """ - - first_name: str # noqa: E501 - """ - [optional] - """ - - last_name: str # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "username": "username", # noqa: E501 - "first_name": "first_name", # noqa: E501 - "last_name": "last_name", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, username, *args, **kwargs): # noqa: E501 - """BasicUserRequest - a model defined in OpenAPI - - Args: - username (str): Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.username = username - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, username, *args, **kwargs): # noqa: E501 - """BasicUserRequest - a model defined in OpenAPI - - Args: - username (str): Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.username = username - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/chunk_type.py b/cvat-sdk/cvat_sdk/model/chunk_type.py deleted file mode 100644 index 44c2b655..00000000 --- a/cvat-sdk/cvat_sdk/model/chunk_type.py +++ /dev/null @@ -1,310 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class ChunkType(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("value",): { - "VIDEO": "video", - "IMAGESET": "imageset", - "LIST": "list", - }, - } - - validations = {} - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "value": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """ChunkType - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["video", "imageset", "list", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["video", "imageset", "list", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """ChunkType - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["video", "imageset", "list", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["video", "imageset", "list", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/cvat-sdk/cvat_sdk/model/cloud_storage_read.py b/cvat-sdk/cvat_sdk/model/cloud_storage_read.py deleted file mode 100644 index 97272759..00000000 --- a/cvat-sdk/cvat_sdk/model/cloud_storage_read.py +++ /dev/null @@ -1,468 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.basic_user import BasicUser - from cvat_sdk.model.credentials_type_enum import CredentialsTypeEnum - from cvat_sdk.model.manifest import Manifest - from cvat_sdk.model.provider_type_enum import ProviderTypeEnum - - globals()["BasicUser"] = BasicUser - globals()["CredentialsTypeEnum"] = CredentialsTypeEnum - globals()["Manifest"] = Manifest - globals()["ProviderTypeEnum"] = ProviderTypeEnum - - -class CloudStorageRead(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - provider_type (ProviderTypeEnum): - - resource (str): - - display_name (str): - - credentials_type (CredentialsTypeEnum): - - id (int): [optional] # noqa: E501 - - owner (BasicUser): [optional] # noqa: E501 - - manifests ([Manifest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - - created_date (datetime): [optional] # noqa: E501 - - updated_date (datetime): [optional] # noqa: E501 - - specific_attributes (str): [optional] # noqa: E501 - - description (str): [optional] # noqa: E501 - - organization (int, none_type): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("resource",): { - "max_length": 222, - }, - ("display_name",): { - "max_length": 63, - }, - ("specific_attributes",): { - "max_length": 1024, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "provider_type": (ProviderTypeEnum,), # noqa: E501 - "resource": (str,), # noqa: E501 - "display_name": (str,), # noqa: E501 - "credentials_type": (CredentialsTypeEnum,), # noqa: E501 - "id": (int,), # noqa: E501 - "owner": (BasicUser,), # noqa: E501 - "manifests": ([Manifest],), # noqa: E501 - "created_date": (datetime,), # noqa: E501 - "updated_date": (datetime,), # noqa: E501 - "specific_attributes": (str,), # noqa: E501 - "description": (str,), # noqa: E501 - "organization": ( - int, - none_type, - ), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - id: int # noqa: E501 - """ - [optional] - """ - - owner: BasicUser # noqa: E501 - """ - [optional] - """ - - manifests: typing.List[Manifest] # noqa: E501 - """ - [optional, default: []] - [Manifest] - """ - - provider_type: ProviderTypeEnum # noqa: E501 - """ - """ - - resource: str # noqa: E501 - """ - """ - - display_name: str # noqa: E501 - """ - """ - - created_date: datetime # noqa: E501 - """ - [optional] - """ - - updated_date: datetime # noqa: E501 - """ - [optional] - """ - - credentials_type: CredentialsTypeEnum # noqa: E501 - """ - """ - - specific_attributes: str # noqa: E501 - """ - [optional] - """ - - description: str # noqa: E501 - """ - [optional] - """ - - organization: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "provider_type": "provider_type", # noqa: E501 - "resource": "resource", # noqa: E501 - "display_name": "display_name", # noqa: E501 - "credentials_type": "credentials_type", # noqa: E501 - "id": "id", # noqa: E501 - "owner": "owner", # noqa: E501 - "manifests": "manifests", # noqa: E501 - "created_date": "created_date", # noqa: E501 - "updated_date": "updated_date", # noqa: E501 - "specific_attributes": "specific_attributes", # noqa: E501 - "description": "description", # noqa: E501 - "organization": "organization", # noqa: E501 - } - - read_only_vars = { - "id", # noqa: E501 - "created_date", # noqa: E501 - "updated_date", # noqa: E501 - "organization", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data( - cls, provider_type, resource, display_name, credentials_type, *args, **kwargs - ): # noqa: E501 - """CloudStorageRead - a model defined in OpenAPI - - Args: - provider_type (ProviderTypeEnum): - resource (str): - display_name (str): - credentials_type (CredentialsTypeEnum): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - owner (BasicUser): [optional] # noqa: E501 - manifests ([Manifest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - specific_attributes (str): [optional] # noqa: E501 - description (str): [optional] # noqa: E501 - organization (int, none_type): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.provider_type = provider_type - self.resource = resource - self.display_name = display_name - self.credentials_type = credentials_type - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__( - self, provider_type, resource, display_name, credentials_type, *args, **kwargs - ): # noqa: E501 - """CloudStorageRead - a model defined in OpenAPI - - Args: - provider_type (ProviderTypeEnum): - resource (str): - display_name (str): - credentials_type (CredentialsTypeEnum): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - owner (BasicUser): [optional] # noqa: E501 - manifests ([Manifest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - specific_attributes (str): [optional] # noqa: E501 - description (str): [optional] # noqa: E501 - organization (int, none_type): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.provider_type = provider_type - self.resource = resource - self.display_name = display_name - self.credentials_type = credentials_type - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/cloud_storage_write.py b/cvat-sdk/cvat_sdk/model/cloud_storage_write.py deleted file mode 100644 index aedad0c0..00000000 --- a/cvat-sdk/cvat_sdk/model/cloud_storage_write.py +++ /dev/null @@ -1,535 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.basic_user import BasicUser - from cvat_sdk.model.credentials_type_enum import CredentialsTypeEnum - from cvat_sdk.model.manifest import Manifest - from cvat_sdk.model.provider_type_enum import ProviderTypeEnum - - globals()["BasicUser"] = BasicUser - globals()["CredentialsTypeEnum"] = CredentialsTypeEnum - globals()["Manifest"] = Manifest - globals()["ProviderTypeEnum"] = ProviderTypeEnum - - -class CloudStorageWrite(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - provider_type (ProviderTypeEnum): - - resource (str): - - display_name (str): - - credentials_type (CredentialsTypeEnum): - - owner (BasicUser): [optional] # noqa: E501 - - created_date (datetime): [optional] # noqa: E501 - - updated_date (datetime): [optional] # noqa: E501 - - session_token (str): [optional] # noqa: E501 - - account_name (str): [optional] # noqa: E501 - - key (str): [optional] # noqa: E501 - - secret_key (str): [optional] # noqa: E501 - - key_file (str): [optional] # noqa: E501 - - specific_attributes (str): [optional] # noqa: E501 - - description (str): [optional] # noqa: E501 - - id (int): [optional] # noqa: E501 - - manifests ([Manifest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - - organization (int, none_type): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("resource",): { - "max_length": 222, - }, - ("display_name",): { - "max_length": 63, - }, - ("session_token",): { - "max_length": 440, - }, - ("account_name",): { - "max_length": 24, - }, - ("key",): { - "max_length": 20, - }, - ("secret_key",): { - "max_length": 40, - }, - ("specific_attributes",): { - "max_length": 1024, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "provider_type": (ProviderTypeEnum,), # noqa: E501 - "resource": (str,), # noqa: E501 - "display_name": (str,), # noqa: E501 - "credentials_type": (CredentialsTypeEnum,), # noqa: E501 - "owner": (BasicUser,), # noqa: E501 - "created_date": (datetime,), # noqa: E501 - "updated_date": (datetime,), # noqa: E501 - "session_token": (str,), # noqa: E501 - "account_name": (str,), # noqa: E501 - "key": (str,), # noqa: E501 - "secret_key": (str,), # noqa: E501 - "key_file": (str,), # noqa: E501 - "specific_attributes": (str,), # noqa: E501 - "description": (str,), # noqa: E501 - "id": (int,), # noqa: E501 - "manifests": ([Manifest],), # noqa: E501 - "organization": ( - int, - none_type, - ), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - provider_type: ProviderTypeEnum # noqa: E501 - """ - """ - - resource: str # noqa: E501 - """ - """ - - display_name: str # noqa: E501 - """ - """ - - owner: BasicUser # noqa: E501 - """ - [optional] - """ - - credentials_type: CredentialsTypeEnum # noqa: E501 - """ - """ - - created_date: datetime # noqa: E501 - """ - [optional] - """ - - updated_date: datetime # noqa: E501 - """ - [optional] - """ - - session_token: str # noqa: E501 - """ - [optional] - """ - - account_name: str # noqa: E501 - """ - [optional] - """ - - key: str # noqa: E501 - """ - [optional] - """ - - secret_key: str # noqa: E501 - """ - [optional] - """ - - key_file: str # noqa: E501 - """ - [optional] - """ - - specific_attributes: str # noqa: E501 - """ - [optional] - """ - - description: str # noqa: E501 - """ - [optional] - """ - - id: int # noqa: E501 - """ - [optional] - """ - - manifests: typing.List[Manifest] # noqa: E501 - """ - [optional, default: []] - [Manifest] - """ - - organization: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "provider_type": "provider_type", # noqa: E501 - "resource": "resource", # noqa: E501 - "display_name": "display_name", # noqa: E501 - "credentials_type": "credentials_type", # noqa: E501 - "owner": "owner", # noqa: E501 - "created_date": "created_date", # noqa: E501 - "updated_date": "updated_date", # noqa: E501 - "session_token": "session_token", # noqa: E501 - "account_name": "account_name", # noqa: E501 - "key": "key", # noqa: E501 - "secret_key": "secret_key", # noqa: E501 - "key_file": "key_file", # noqa: E501 - "specific_attributes": "specific_attributes", # noqa: E501 - "description": "description", # noqa: E501 - "id": "id", # noqa: E501 - "manifests": "manifests", # noqa: E501 - "organization": "organization", # noqa: E501 - } - - read_only_vars = { - "created_date", # noqa: E501 - "updated_date", # noqa: E501 - "id", # noqa: E501 - "organization", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data( - cls, provider_type, resource, display_name, credentials_type, *args, **kwargs - ): # noqa: E501 - """CloudStorageWrite - a model defined in OpenAPI - - Args: - provider_type (ProviderTypeEnum): - resource (str): - display_name (str): - credentials_type (CredentialsTypeEnum): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - owner (BasicUser): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - session_token (str): [optional] # noqa: E501 - account_name (str): [optional] # noqa: E501 - key (str): [optional] # noqa: E501 - secret_key (str): [optional] # noqa: E501 - key_file (str): [optional] # noqa: E501 - specific_attributes (str): [optional] # noqa: E501 - description (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - manifests ([Manifest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - organization (int, none_type): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.provider_type = provider_type - self.resource = resource - self.display_name = display_name - self.credentials_type = credentials_type - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__( - self, provider_type, resource, display_name, credentials_type, *args, **kwargs - ): # noqa: E501 - """CloudStorageWrite - a model defined in OpenAPI - - Args: - provider_type (ProviderTypeEnum): - resource (str): - display_name (str): - credentials_type (CredentialsTypeEnum): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - owner (BasicUser): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - session_token (str): [optional] # noqa: E501 - account_name (str): [optional] # noqa: E501 - key (str): [optional] # noqa: E501 - secret_key (str): [optional] # noqa: E501 - key_file (str): [optional] # noqa: E501 - specific_attributes (str): [optional] # noqa: E501 - description (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - manifests ([Manifest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - organization (int, none_type): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.provider_type = provider_type - self.resource = resource - self.display_name = display_name - self.credentials_type = credentials_type - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/cloud_storage_write_request.py b/cvat-sdk/cvat_sdk/model/cloud_storage_write_request.py deleted file mode 100644 index 62c502b6..00000000 --- a/cvat-sdk/cvat_sdk/model/cloud_storage_write_request.py +++ /dev/null @@ -1,485 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.basic_user_request import BasicUserRequest - from cvat_sdk.model.credentials_type_enum import CredentialsTypeEnum - from cvat_sdk.model.manifest_request import ManifestRequest - from cvat_sdk.model.provider_type_enum import ProviderTypeEnum - - globals()["BasicUserRequest"] = BasicUserRequest - globals()["CredentialsTypeEnum"] = CredentialsTypeEnum - globals()["ManifestRequest"] = ManifestRequest - globals()["ProviderTypeEnum"] = ProviderTypeEnum - - -class CloudStorageWriteRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - provider_type (ProviderTypeEnum): - - resource (str): - - display_name (str): - - credentials_type (CredentialsTypeEnum): - - owner (BasicUserRequest): [optional] # noqa: E501 - - session_token (str): [optional] # noqa: E501 - - account_name (str): [optional] # noqa: E501 - - key (str): [optional] # noqa: E501 - - secret_key (str): [optional] # noqa: E501 - - key_file (file_type): [optional] # noqa: E501 - - specific_attributes (str): [optional] # noqa: E501 - - description (str): [optional] # noqa: E501 - - manifests ([ManifestRequest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("resource",): { - "max_length": 222, - "min_length": 1, - }, - ("display_name",): { - "max_length": 63, - "min_length": 1, - }, - ("session_token",): { - "max_length": 440, - }, - ("account_name",): { - "max_length": 24, - }, - ("key",): { - "max_length": 20, - }, - ("secret_key",): { - "max_length": 40, - }, - ("specific_attributes",): { - "max_length": 1024, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "provider_type": (ProviderTypeEnum,), # noqa: E501 - "resource": (str,), # noqa: E501 - "display_name": (str,), # noqa: E501 - "credentials_type": (CredentialsTypeEnum,), # noqa: E501 - "owner": (BasicUserRequest,), # noqa: E501 - "session_token": (str,), # noqa: E501 - "account_name": (str,), # noqa: E501 - "key": (str,), # noqa: E501 - "secret_key": (str,), # noqa: E501 - "key_file": (file_type,), # noqa: E501 - "specific_attributes": (str,), # noqa: E501 - "description": (str,), # noqa: E501 - "manifests": ([ManifestRequest],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - provider_type: ProviderTypeEnum # noqa: E501 - """ - """ - - resource: str # noqa: E501 - """ - """ - - display_name: str # noqa: E501 - """ - """ - - owner: BasicUserRequest # noqa: E501 - """ - [optional] - """ - - credentials_type: CredentialsTypeEnum # noqa: E501 - """ - """ - - session_token: str # noqa: E501 - """ - [optional] - """ - - account_name: str # noqa: E501 - """ - [optional] - """ - - key: str # noqa: E501 - """ - [optional] - """ - - secret_key: str # noqa: E501 - """ - [optional] - """ - - key_file: file_type # noqa: E501 - """ - [optional] - """ - - specific_attributes: str # noqa: E501 - """ - [optional] - """ - - description: str # noqa: E501 - """ - [optional] - """ - - manifests: typing.List[ManifestRequest] # noqa: E501 - """ - [optional, default: []] - [ManifestRequest] - """ - - attribute_map = { - "provider_type": "provider_type", # noqa: E501 - "resource": "resource", # noqa: E501 - "display_name": "display_name", # noqa: E501 - "credentials_type": "credentials_type", # noqa: E501 - "owner": "owner", # noqa: E501 - "session_token": "session_token", # noqa: E501 - "account_name": "account_name", # noqa: E501 - "key": "key", # noqa: E501 - "secret_key": "secret_key", # noqa: E501 - "key_file": "key_file", # noqa: E501 - "specific_attributes": "specific_attributes", # noqa: E501 - "description": "description", # noqa: E501 - "manifests": "manifests", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data( - cls, provider_type, resource, display_name, credentials_type, *args, **kwargs - ): # noqa: E501 - """CloudStorageWriteRequest - a model defined in OpenAPI - - Args: - provider_type (ProviderTypeEnum): - resource (str): - display_name (str): - credentials_type (CredentialsTypeEnum): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - owner (BasicUserRequest): [optional] # noqa: E501 - session_token (str): [optional] # noqa: E501 - account_name (str): [optional] # noqa: E501 - key (str): [optional] # noqa: E501 - secret_key (str): [optional] # noqa: E501 - key_file (file_type): [optional] # noqa: E501 - specific_attributes (str): [optional] # noqa: E501 - description (str): [optional] # noqa: E501 - manifests ([ManifestRequest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.provider_type = provider_type - self.resource = resource - self.display_name = display_name - self.credentials_type = credentials_type - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__( - self, provider_type, resource, display_name, credentials_type, *args, **kwargs - ): # noqa: E501 - """CloudStorageWriteRequest - a model defined in OpenAPI - - Args: - provider_type (ProviderTypeEnum): - resource (str): - display_name (str): - credentials_type (CredentialsTypeEnum): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - owner (BasicUserRequest): [optional] # noqa: E501 - session_token (str): [optional] # noqa: E501 - account_name (str): [optional] # noqa: E501 - key (str): [optional] # noqa: E501 - secret_key (str): [optional] # noqa: E501 - key_file (file_type): [optional] # noqa: E501 - specific_attributes (str): [optional] # noqa: E501 - description (str): [optional] # noqa: E501 - manifests ([ManifestRequest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.provider_type = provider_type - self.resource = resource - self.display_name = display_name - self.credentials_type = credentials_type - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/comment_read.py b/cvat-sdk/cvat_sdk/model/comment_read.py deleted file mode 100644 index cdb67324..00000000 --- a/cvat-sdk/cvat_sdk/model/comment_read.py +++ /dev/null @@ -1,371 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.comment_read_owner import CommentReadOwner - - globals()["CommentReadOwner"] = CommentReadOwner - - -class CommentRead(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - id (int): [optional] # noqa: E501 - - issue (int): [optional] # noqa: E501 - - owner (CommentReadOwner): [optional] # noqa: E501 - - message (str): [optional] # noqa: E501 - - created_date (datetime): [optional] # noqa: E501 - - updated_date (datetime): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "id": (int,), # noqa: E501 - "issue": (int,), # noqa: E501 - "owner": (CommentReadOwner,), # noqa: E501 - "message": (str,), # noqa: E501 - "created_date": (datetime,), # noqa: E501 - "updated_date": (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - id: int # noqa: E501 - """ - [optional] - """ - - issue: int # noqa: E501 - """ - [optional] - """ - - owner: CommentReadOwner # noqa: E501 - """ - [optional] - """ - - message: str # noqa: E501 - """ - [optional] - """ - - created_date: datetime # noqa: E501 - """ - [optional] - """ - - updated_date: datetime # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "id": "id", # noqa: E501 - "issue": "issue", # noqa: E501 - "owner": "owner", # noqa: E501 - "message": "message", # noqa: E501 - "created_date": "created_date", # noqa: E501 - "updated_date": "updated_date", # noqa: E501 - } - - read_only_vars = { - "id", # noqa: E501 - "issue", # noqa: E501 - "message", # noqa: E501 - "created_date", # noqa: E501 - "updated_date", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """CommentRead - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - issue (int): [optional] # noqa: E501 - owner (CommentReadOwner): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """CommentRead - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - issue (int): [optional] # noqa: E501 - owner (CommentReadOwner): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/comment_read_owner.py b/cvat-sdk/cvat_sdk/model/comment_read_owner.py deleted file mode 100644 index c636904b..00000000 --- a/cvat-sdk/cvat_sdk/model/comment_read_owner.py +++ /dev/null @@ -1,411 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.basic_user import BasicUser - - globals()["BasicUser"] = BasicUser - - -class CommentReadOwner(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = { - ("username",): { - "max_length": 150, - "regex": { - "pattern": r"^[\w.@+-]+$", # noqa: E501 - }, - }, - ("first_name",): { - "max_length": 150, - }, - ("last_name",): { - "max_length": 150, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "username": (str,), # noqa: E501 - "url": (str,), # noqa: E501 - "id": (int,), # noqa: E501 - "first_name": (str,), # noqa: E501 - "last_name": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - url: str # noqa: E501 - """ - [optional] - """ - - id: int # noqa: E501 - """ - [optional] - """ - - username: str # noqa: E501 - """ - Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.. - """ - - first_name: str # noqa: E501 - """ - [optional] - """ - - last_name: str # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "username": "username", # noqa: E501 - "url": "url", # noqa: E501 - "id": "id", # noqa: E501 - "first_name": "first_name", # noqa: E501 - "last_name": "last_name", # noqa: E501 - } - - read_only_vars = { - "url", # noqa: E501 - "id", # noqa: E501 - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, username, *args, **kwargs) -> CommentReadOwner: # noqa: E501 - """CommentReadOwner - a model defined in OpenAPI - - Keyword Args: - username (str): Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - "_check_type": _check_type, - "_path_to_item": _path_to_item, - "_spec_property_naming": _spec_property_naming, - "_configuration": _configuration, - "_visited_composed_classes": self._visited_composed_classes, - } - required_args = { - "username": username, - } - kwargs.update(required_args) - composed_info = validate_get_composed_info(constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if ( - var_name in discarded_args - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self._additional_properties_model_instances - ): - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - "_composed_instances", - "_var_name_to_model_instances", - "_additional_properties_model_instances", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, username, *args, **kwargs): # noqa: E501 - """CommentReadOwner - a model defined in OpenAPI - - Keyword Args: - username (str): Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - "_check_type": _check_type, - "_path_to_item": _path_to_item, - "_spec_property_naming": _spec_property_naming, - "_configuration": _configuration, - "_visited_composed_classes": self._visited_composed_classes, - } - required_args = { - "username": username, - } - kwargs.update(required_args) - composed_info = validate_get_composed_info(constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if ( - var_name in discarded_args - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self._additional_properties_model_instances - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - "anyOf": [], - "allOf": [ - BasicUser, - ], - "oneOf": [], - } diff --git a/cvat-sdk/cvat_sdk/model/comment_write.py b/cvat-sdk/cvat_sdk/model/comment_write.py deleted file mode 100644 index d8a27bb3..00000000 --- a/cvat-sdk/cvat_sdk/model/comment_write.py +++ /dev/null @@ -1,367 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class CommentWrite(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - issue (int): - - id (int): [optional] # noqa: E501 - - owner (int): [optional] # noqa: E501 - - message (str): [optional] # noqa: E501 - - created_date (datetime): [optional] # noqa: E501 - - updated_date (datetime): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "issue": (int,), # noqa: E501 - "id": (int,), # noqa: E501 - "owner": (int,), # noqa: E501 - "message": (str,), # noqa: E501 - "created_date": (datetime,), # noqa: E501 - "updated_date": (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - id: int # noqa: E501 - """ - [optional] - """ - - issue: int # noqa: E501 - """ - """ - - owner: int # noqa: E501 - """ - [optional] - """ - - message: str # noqa: E501 - """ - [optional] - """ - - created_date: datetime # noqa: E501 - """ - [optional] - """ - - updated_date: datetime # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "issue": "issue", # noqa: E501 - "id": "id", # noqa: E501 - "owner": "owner", # noqa: E501 - "message": "message", # noqa: E501 - "created_date": "created_date", # noqa: E501 - "updated_date": "updated_date", # noqa: E501 - } - - read_only_vars = { - "id", # noqa: E501 - "owner", # noqa: E501 - "created_date", # noqa: E501 - "updated_date", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, issue, *args, **kwargs): # noqa: E501 - """CommentWrite - a model defined in OpenAPI - - Args: - issue (int): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - owner (int): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.issue = issue - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, issue, *args, **kwargs): # noqa: E501 - """CommentWrite - a model defined in OpenAPI - - Args: - issue (int): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - owner (int): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.issue = issue - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/comment_write_request.py b/cvat-sdk/cvat_sdk/model/comment_write_request.py deleted file mode 100644 index be03390f..00000000 --- a/cvat-sdk/cvat_sdk/model/comment_write_request.py +++ /dev/null @@ -1,322 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class CommentWriteRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - issue (int): - - message (str): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("message",): { - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "issue": (int,), # noqa: E501 - "message": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - issue: int # noqa: E501 - """ - """ - - message: str # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "issue": "issue", # noqa: E501 - "message": "message", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, issue, *args, **kwargs): # noqa: E501 - """CommentWriteRequest - a model defined in OpenAPI - - Args: - issue (int): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - message (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.issue = issue - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, issue, *args, **kwargs): # noqa: E501 - """CommentWriteRequest - a model defined in OpenAPI - - Args: - issue (int): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - message (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.issue = issue - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/credentials_type_enum.py b/cvat-sdk/cvat_sdk/model/credentials_type_enum.py deleted file mode 100644 index 6723a4bc..00000000 --- a/cvat-sdk/cvat_sdk/model/credentials_type_enum.py +++ /dev/null @@ -1,311 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class CredentialsTypeEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("value",): { - "KEY_SECRET_KEY_PAIR": "KEY_SECRET_KEY_PAIR", - "ACCOUNT_NAME_TOKEN_PAIR": "ACCOUNT_NAME_TOKEN_PAIR", - "KEY_FILE_PATH": "KEY_FILE_PATH", - "ANONYMOUS_ACCESS": "ANONYMOUS_ACCESS", - }, - } - - validations = {} - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "value": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """CredentialsTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["KEY_SECRET_KEY_PAIR", "ACCOUNT_NAME_TOKEN_PAIR", "KEY_FILE_PATH", "ANONYMOUS_ACCESS", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["KEY_SECRET_KEY_PAIR", "ACCOUNT_NAME_TOKEN_PAIR", "KEY_FILE_PATH", "ANONYMOUS_ACCESS", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """CredentialsTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["KEY_SECRET_KEY_PAIR", "ACCOUNT_NAME_TOKEN_PAIR", "KEY_FILE_PATH", "ANONYMOUS_ACCESS", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["KEY_SECRET_KEY_PAIR", "ACCOUNT_NAME_TOKEN_PAIR", "KEY_FILE_PATH", "ANONYMOUS_ACCESS", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/cvat-sdk/cvat_sdk/model/data_meta_read.py b/cvat-sdk/cvat_sdk/model/data_meta_read.py deleted file mode 100644 index c756ef4c..00000000 --- a/cvat-sdk/cvat_sdk/model/data_meta_read.py +++ /dev/null @@ -1,412 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.frame_meta import FrameMeta - - globals()["FrameMeta"] = FrameMeta - - -class DataMetaRead(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - image_quality (int): - - frames ([FrameMeta], none_type): - - deleted_frames ([int]): - - chunk_size (int): [optional] # noqa: E501 - - size (int): [optional] # noqa: E501 - - start_frame (int): [optional] # noqa: E501 - - stop_frame (int): [optional] # noqa: E501 - - frame_filter (str): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("image_quality",): { - "inclusive_maximum": 100, - "inclusive_minimum": 0, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "image_quality": (int,), # noqa: E501 - "frames": ( - [FrameMeta], - none_type, - ), # noqa: E501 - "deleted_frames": ([int],), # noqa: E501 - "chunk_size": (int,), # noqa: E501 - "size": (int,), # noqa: E501 - "start_frame": (int,), # noqa: E501 - "stop_frame": (int,), # noqa: E501 - "frame_filter": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - chunk_size: int # noqa: E501 - """ - [optional] - """ - - size: int # noqa: E501 - """ - [optional] - """ - - image_quality: int # noqa: E501 - """ - """ - - start_frame: int # noqa: E501 - """ - [optional] - """ - - stop_frame: int # noqa: E501 - """ - [optional] - """ - - frame_filter: str # noqa: E501 - """ - [optional] - """ - - frames: typing.Union[typing.List[FrameMeta], none_type] # noqa: E501 - """ - [FrameMeta], none_type - """ - - deleted_frames: typing.List[int] # noqa: E501 - """ - [int] - """ - - attribute_map = { - "image_quality": "image_quality", # noqa: E501 - "frames": "frames", # noqa: E501 - "deleted_frames": "deleted_frames", # noqa: E501 - "chunk_size": "chunk_size", # noqa: E501 - "size": "size", # noqa: E501 - "start_frame": "start_frame", # noqa: E501 - "stop_frame": "stop_frame", # noqa: E501 - "frame_filter": "frame_filter", # noqa: E501 - } - - read_only_vars = { - "chunk_size", # noqa: E501 - "size", # noqa: E501 - "start_frame", # noqa: E501 - "stop_frame", # noqa: E501 - "frame_filter", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data( - cls, image_quality, frames, deleted_frames, *args, **kwargs - ): # noqa: E501 - """DataMetaRead - a model defined in OpenAPI - - Args: - image_quality (int): - frames ([FrameMeta], none_type): - deleted_frames ([int]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - chunk_size (int): [optional] # noqa: E501 - size (int): [optional] # noqa: E501 - start_frame (int): [optional] # noqa: E501 - stop_frame (int): [optional] # noqa: E501 - frame_filter (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.image_quality = image_quality - self.frames = frames - self.deleted_frames = deleted_frames - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, image_quality, frames, deleted_frames, *args, **kwargs): # noqa: E501 - """DataMetaRead - a model defined in OpenAPI - - Args: - image_quality (int): - frames ([FrameMeta], none_type): - deleted_frames ([int]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - chunk_size (int): [optional] # noqa: E501 - size (int): [optional] # noqa: E501 - start_frame (int): [optional] # noqa: E501 - stop_frame (int): [optional] # noqa: E501 - frame_filter (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.image_quality = image_quality - self.frames = frames - self.deleted_frames = deleted_frames - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/data_request.py b/cvat-sdk/cvat_sdk/model/data_request.py deleted file mode 100644 index 4e8a36b2..00000000 --- a/cvat-sdk/cvat_sdk/model/data_request.py +++ /dev/null @@ -1,525 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.chunk_type import ChunkType - from cvat_sdk.model.sorting_method import SortingMethod - from cvat_sdk.model.storage_method import StorageMethod - from cvat_sdk.model.storage_type import StorageType - - globals()["ChunkType"] = ChunkType - globals()["SortingMethod"] = SortingMethod - globals()["StorageMethod"] = StorageMethod - globals()["StorageType"] = StorageType - - -class DataRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - image_quality (int): - - chunk_size (int, none_type): [optional] # noqa: E501 - - size (int): [optional] # noqa: E501 - - start_frame (int): [optional] # noqa: E501 - - stop_frame (int): [optional] # noqa: E501 - - frame_filter (str): [optional] # noqa: E501 - - compressed_chunk_type (ChunkType): [optional] # noqa: E501 - - original_chunk_type (ChunkType): [optional] # noqa: E501 - - client_files ([file_type]): [optional] if omitted the server will use the default value of [] # noqa: E501 - - server_files ([str]): [optional] if omitted the server will use the default value of [] # noqa: E501 - - remote_files ([str]): [optional] if omitted the server will use the default value of [] # noqa: E501 - - use_zip_chunks (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - - cloud_storage_id (int, none_type): [optional] # noqa: E501 - - use_cache (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - - copy_data (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - - storage_method (StorageMethod): [optional] # noqa: E501 - - storage (StorageType): [optional] # noqa: E501 - - sorting_method (SortingMethod): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("image_quality",): { - "inclusive_maximum": 100, - "inclusive_minimum": 0, - }, - ("frame_filter",): { - "max_length": 256, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "image_quality": (int,), # noqa: E501 - "chunk_size": ( - int, - none_type, - ), # noqa: E501 - "size": (int,), # noqa: E501 - "start_frame": (int,), # noqa: E501 - "stop_frame": (int,), # noqa: E501 - "frame_filter": (str,), # noqa: E501 - "compressed_chunk_type": (ChunkType,), # noqa: E501 - "original_chunk_type": (ChunkType,), # noqa: E501 - "client_files": ([file_type],), # noqa: E501 - "server_files": ([str],), # noqa: E501 - "remote_files": ([str],), # noqa: E501 - "use_zip_chunks": (bool,), # noqa: E501 - "cloud_storage_id": ( - int, - none_type, - ), # noqa: E501 - "use_cache": (bool,), # noqa: E501 - "copy_data": (bool,), # noqa: E501 - "storage_method": (StorageMethod,), # noqa: E501 - "storage": (StorageType,), # noqa: E501 - "sorting_method": (SortingMethod,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - chunk_size: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - size: int # noqa: E501 - """ - [optional] - """ - - image_quality: int # noqa: E501 - """ - """ - - start_frame: int # noqa: E501 - """ - [optional] - """ - - stop_frame: int # noqa: E501 - """ - [optional] - """ - - frame_filter: str # noqa: E501 - """ - [optional] - """ - - compressed_chunk_type: ChunkType # noqa: E501 - """ - [optional] - """ - - original_chunk_type: ChunkType # noqa: E501 - """ - [optional] - """ - - client_files: typing.List[file_type] # noqa: E501 - """ - [optional, default: []] - [file_type] - """ - - server_files: typing.List[str] # noqa: E501 - """ - [optional, default: []] - [str] - """ - - remote_files: typing.List[str] # noqa: E501 - """ - [optional, default: []] - [str] - """ - - use_zip_chunks: bool # noqa: E501 - """ - [optional, default: False] - """ - - cloud_storage_id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - use_cache: bool # noqa: E501 - """ - [optional, default: False] - """ - - copy_data: bool # noqa: E501 - """ - [optional, default: False] - """ - - storage_method: StorageMethod # noqa: E501 - """ - [optional] - """ - - storage: StorageType # noqa: E501 - """ - [optional] - """ - - sorting_method: SortingMethod # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "image_quality": "image_quality", # noqa: E501 - "chunk_size": "chunk_size", # noqa: E501 - "size": "size", # noqa: E501 - "start_frame": "start_frame", # noqa: E501 - "stop_frame": "stop_frame", # noqa: E501 - "frame_filter": "frame_filter", # noqa: E501 - "compressed_chunk_type": "compressed_chunk_type", # noqa: E501 - "original_chunk_type": "original_chunk_type", # noqa: E501 - "client_files": "client_files", # noqa: E501 - "server_files": "server_files", # noqa: E501 - "remote_files": "remote_files", # noqa: E501 - "use_zip_chunks": "use_zip_chunks", # noqa: E501 - "cloud_storage_id": "cloud_storage_id", # noqa: E501 - "use_cache": "use_cache", # noqa: E501 - "copy_data": "copy_data", # noqa: E501 - "storage_method": "storage_method", # noqa: E501 - "storage": "storage", # noqa: E501 - "sorting_method": "sorting_method", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, image_quality, *args, **kwargs): # noqa: E501 - """DataRequest - a model defined in OpenAPI - - Args: - image_quality (int): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - chunk_size (int, none_type): [optional] # noqa: E501 - size (int): [optional] # noqa: E501 - start_frame (int): [optional] # noqa: E501 - stop_frame (int): [optional] # noqa: E501 - frame_filter (str): [optional] # noqa: E501 - compressed_chunk_type (ChunkType): [optional] # noqa: E501 - original_chunk_type (ChunkType): [optional] # noqa: E501 - client_files ([file_type]): [optional] if omitted the server will use the default value of [] # noqa: E501 - server_files ([str]): [optional] if omitted the server will use the default value of [] # noqa: E501 - remote_files ([str]): [optional] if omitted the server will use the default value of [] # noqa: E501 - use_zip_chunks (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - cloud_storage_id (int, none_type): [optional] # noqa: E501 - use_cache (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - copy_data (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - storage_method (StorageMethod): [optional] # noqa: E501 - storage (StorageType): [optional] # noqa: E501 - sorting_method (SortingMethod): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.image_quality = image_quality - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, image_quality, *args, **kwargs): # noqa: E501 - """DataRequest - a model defined in OpenAPI - - Args: - image_quality (int): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - chunk_size (int, none_type): [optional] # noqa: E501 - size (int): [optional] # noqa: E501 - start_frame (int): [optional] # noqa: E501 - stop_frame (int): [optional] # noqa: E501 - frame_filter (str): [optional] # noqa: E501 - compressed_chunk_type (ChunkType): [optional] # noqa: E501 - original_chunk_type (ChunkType): [optional] # noqa: E501 - client_files ([file_type]): [optional] if omitted the server will use the default value of [] # noqa: E501 - server_files ([str]): [optional] if omitted the server will use the default value of [] # noqa: E501 - remote_files ([str]): [optional] if omitted the server will use the default value of [] # noqa: E501 - use_zip_chunks (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - cloud_storage_id (int, none_type): [optional] # noqa: E501 - use_cache (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - copy_data (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - storage_method (StorageMethod): [optional] # noqa: E501 - storage (StorageType): [optional] # noqa: E501 - sorting_method (SortingMethod): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.image_quality = image_quality - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/dataset_file_request.py b/cvat-sdk/cvat_sdk/model/dataset_file_request.py deleted file mode 100644 index 133704a2..00000000 --- a/cvat-sdk/cvat_sdk/model/dataset_file_request.py +++ /dev/null @@ -1,307 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class DatasetFileRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - dataset_file (file_type): - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "dataset_file": (file_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - dataset_file: file_type # noqa: E501 - """ - """ - - attribute_map = { - "dataset_file": "dataset_file", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, dataset_file, *args, **kwargs): # noqa: E501 - """DatasetFileRequest - a model defined in OpenAPI - - Args: - dataset_file (file_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.dataset_file = dataset_file - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, dataset_file, *args, **kwargs): # noqa: E501 - """DatasetFileRequest - a model defined in OpenAPI - - Args: - dataset_file (file_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.dataset_file = dataset_file - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/dataset_format.py b/cvat-sdk/cvat_sdk/model/dataset_format.py deleted file mode 100644 index bc6d821b..00000000 --- a/cvat-sdk/cvat_sdk/model/dataset_format.py +++ /dev/null @@ -1,370 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class DatasetFormat(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - name (str): - - ext (str): - - version (str): - - enabled (bool): - - dimension (str): - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("name",): { - "max_length": 64, - }, - ("ext",): { - "max_length": 64, - }, - ("version",): { - "max_length": 64, - }, - ("dimension",): { - "max_length": 2, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "name": (str,), # noqa: E501 - "ext": (str,), # noqa: E501 - "version": (str,), # noqa: E501 - "enabled": (bool,), # noqa: E501 - "dimension": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - name: str # noqa: E501 - """ - """ - - ext: str # noqa: E501 - """ - """ - - version: str # noqa: E501 - """ - """ - - enabled: bool # noqa: E501 - """ - """ - - dimension: str # noqa: E501 - """ - """ - - attribute_map = { - "name": "name", # noqa: E501 - "ext": "ext", # noqa: E501 - "version": "version", # noqa: E501 - "enabled": "enabled", # noqa: E501 - "dimension": "dimension", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data( - cls, name, ext, version, enabled, dimension, *args, **kwargs - ): # noqa: E501 - """DatasetFormat - a model defined in OpenAPI - - Args: - name (str): - ext (str): - version (str): - enabled (bool): - dimension (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.ext = ext - self.version = version - self.enabled = enabled - self.dimension = dimension - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, name, ext, version, enabled, dimension, *args, **kwargs): # noqa: E501 - """DatasetFormat - a model defined in OpenAPI - - Args: - name (str): - ext (str): - version (str): - enabled (bool): - dimension (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.ext = ext - self.version = version - self.enabled = enabled - self.dimension = dimension - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/dataset_formats.py b/cvat-sdk/cvat_sdk/model/dataset_formats.py deleted file mode 100644 index 29a76d9d..00000000 --- a/cvat-sdk/cvat_sdk/model/dataset_formats.py +++ /dev/null @@ -1,329 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.dataset_format import DatasetFormat - - globals()["DatasetFormat"] = DatasetFormat - - -class DatasetFormats(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - importers ([DatasetFormat]): - - exporters ([DatasetFormat]): - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "importers": ([DatasetFormat],), # noqa: E501 - "exporters": ([DatasetFormat],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - importers: typing.List[DatasetFormat] # noqa: E501 - """ - [DatasetFormat] - """ - - exporters: typing.List[DatasetFormat] # noqa: E501 - """ - [DatasetFormat] - """ - - attribute_map = { - "importers": "importers", # noqa: E501 - "exporters": "exporters", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, importers, exporters, *args, **kwargs): # noqa: E501 - """DatasetFormats - a model defined in OpenAPI - - Args: - importers ([DatasetFormat]): - exporters ([DatasetFormat]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.importers = importers - self.exporters = exporters - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, importers, exporters, *args, **kwargs): # noqa: E501 - """DatasetFormats - a model defined in OpenAPI - - Args: - importers ([DatasetFormat]): - exporters ([DatasetFormat]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.importers = importers - self.exporters = exporters - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/exception.py b/cvat-sdk/cvat_sdk/model/exception.py deleted file mode 100644 index efd85a56..00000000 --- a/cvat-sdk/cvat_sdk/model/exception.py +++ /dev/null @@ -1,475 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class Exception(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - system (str): - - client (str): - - time (datetime): - - client_id (int): - - message (str): - - filename (str): - - line (int): - - column (int): - - stack (str): - - job_id (int): [optional] # noqa: E501 - - task_id (int): [optional] # noqa: E501 - - proj_id (int): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("system",): { - "max_length": 255, - }, - ("client",): { - "max_length": 255, - }, - ("message",): { - "max_length": 4096, - }, - ("stack",): { - "max_length": 8192, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "system": (str,), # noqa: E501 - "client": (str,), # noqa: E501 - "time": (datetime,), # noqa: E501 - "client_id": (int,), # noqa: E501 - "message": (str,), # noqa: E501 - "filename": (str,), # noqa: E501 - "line": (int,), # noqa: E501 - "column": (int,), # noqa: E501 - "stack": (str,), # noqa: E501 - "job_id": (int,), # noqa: E501 - "task_id": (int,), # noqa: E501 - "proj_id": (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - system: str # noqa: E501 - """ - """ - - client: str # noqa: E501 - """ - """ - - time: datetime # noqa: E501 - """ - """ - - job_id: int # noqa: E501 - """ - [optional] - """ - - task_id: int # noqa: E501 - """ - [optional] - """ - - proj_id: int # noqa: E501 - """ - [optional] - """ - - client_id: int # noqa: E501 - """ - """ - - message: str # noqa: E501 - """ - """ - - filename: str # noqa: E501 - """ - """ - - line: int # noqa: E501 - """ - """ - - column: int # noqa: E501 - """ - """ - - stack: str # noqa: E501 - """ - """ - - attribute_map = { - "system": "system", # noqa: E501 - "client": "client", # noqa: E501 - "time": "time", # noqa: E501 - "client_id": "client_id", # noqa: E501 - "message": "message", # noqa: E501 - "filename": "filename", # noqa: E501 - "line": "line", # noqa: E501 - "column": "column", # noqa: E501 - "stack": "stack", # noqa: E501 - "job_id": "job_id", # noqa: E501 - "task_id": "task_id", # noqa: E501 - "proj_id": "proj_id", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data( - cls, - system, - client, - time, - client_id, - message, - filename, - line, - column, - stack, - *args, - **kwargs, - ): # noqa: E501 - """Exception - a model defined in OpenAPI - - Args: - system (str): - client (str): - time (datetime): - client_id (int): - message (str): - filename (str): - line (int): - column (int): - stack (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - job_id (int): [optional] # noqa: E501 - task_id (int): [optional] # noqa: E501 - proj_id (int): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.system = system - self.client = client - self.time = time - self.client_id = client_id - self.message = message - self.filename = filename - self.line = line - self.column = column - self.stack = stack - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__( - self, - system, - client, - time, - client_id, - message, - filename, - line, - column, - stack, - *args, - **kwargs, - ): # noqa: E501 - """Exception - a model defined in OpenAPI - - Args: - system (str): - client (str): - time (datetime): - client_id (int): - message (str): - filename (str): - line (int): - column (int): - stack (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - job_id (int): [optional] # noqa: E501 - task_id (int): [optional] # noqa: E501 - proj_id (int): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.system = system - self.client = client - self.time = time - self.client_id = client_id - self.message = message - self.filename = filename - self.line = line - self.column = column - self.stack = stack - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/exception_request.py b/cvat-sdk/cvat_sdk/model/exception_request.py deleted file mode 100644 index 6012cca3..00000000 --- a/cvat-sdk/cvat_sdk/model/exception_request.py +++ /dev/null @@ -1,481 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class ExceptionRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - system (str): - - client (str): - - time (datetime): - - client_id (int): - - message (str): - - filename (str): - - line (int): - - column (int): - - stack (str): - - job_id (int): [optional] # noqa: E501 - - task_id (int): [optional] # noqa: E501 - - proj_id (int): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("system",): { - "max_length": 255, - "min_length": 1, - }, - ("client",): { - "max_length": 255, - "min_length": 1, - }, - ("message",): { - "max_length": 4096, - "min_length": 1, - }, - ("filename",): { - "min_length": 1, - }, - ("stack",): { - "max_length": 8192, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "system": (str,), # noqa: E501 - "client": (str,), # noqa: E501 - "time": (datetime,), # noqa: E501 - "client_id": (int,), # noqa: E501 - "message": (str,), # noqa: E501 - "filename": (str,), # noqa: E501 - "line": (int,), # noqa: E501 - "column": (int,), # noqa: E501 - "stack": (str,), # noqa: E501 - "job_id": (int,), # noqa: E501 - "task_id": (int,), # noqa: E501 - "proj_id": (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - system: str # noqa: E501 - """ - """ - - client: str # noqa: E501 - """ - """ - - time: datetime # noqa: E501 - """ - """ - - job_id: int # noqa: E501 - """ - [optional] - """ - - task_id: int # noqa: E501 - """ - [optional] - """ - - proj_id: int # noqa: E501 - """ - [optional] - """ - - client_id: int # noqa: E501 - """ - """ - - message: str # noqa: E501 - """ - """ - - filename: str # noqa: E501 - """ - """ - - line: int # noqa: E501 - """ - """ - - column: int # noqa: E501 - """ - """ - - stack: str # noqa: E501 - """ - """ - - attribute_map = { - "system": "system", # noqa: E501 - "client": "client", # noqa: E501 - "time": "time", # noqa: E501 - "client_id": "client_id", # noqa: E501 - "message": "message", # noqa: E501 - "filename": "filename", # noqa: E501 - "line": "line", # noqa: E501 - "column": "column", # noqa: E501 - "stack": "stack", # noqa: E501 - "job_id": "job_id", # noqa: E501 - "task_id": "task_id", # noqa: E501 - "proj_id": "proj_id", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data( - cls, - system, - client, - time, - client_id, - message, - filename, - line, - column, - stack, - *args, - **kwargs, - ): # noqa: E501 - """ExceptionRequest - a model defined in OpenAPI - - Args: - system (str): - client (str): - time (datetime): - client_id (int): - message (str): - filename (str): - line (int): - column (int): - stack (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - job_id (int): [optional] # noqa: E501 - task_id (int): [optional] # noqa: E501 - proj_id (int): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.system = system - self.client = client - self.time = time - self.client_id = client_id - self.message = message - self.filename = filename - self.line = line - self.column = column - self.stack = stack - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__( - self, - system, - client, - time, - client_id, - message, - filename, - line, - column, - stack, - *args, - **kwargs, - ): # noqa: E501 - """ExceptionRequest - a model defined in OpenAPI - - Args: - system (str): - client (str): - time (datetime): - client_id (int): - message (str): - filename (str): - line (int): - column (int): - stack (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - job_id (int): [optional] # noqa: E501 - task_id (int): [optional] # noqa: E501 - proj_id (int): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.system = system - self.client = client - self.time = time - self.client_id = client_id - self.message = message - self.filename = filename - self.line = line - self.column = column - self.stack = stack - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/file_info.py b/cvat-sdk/cvat_sdk/model/file_info.py deleted file mode 100644 index fc4d55d9..00000000 --- a/cvat-sdk/cvat_sdk/model/file_info.py +++ /dev/null @@ -1,331 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.file_info_type_enum import FileInfoTypeEnum - - globals()["FileInfoTypeEnum"] = FileInfoTypeEnum - - -class FileInfo(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - name (str): - - type (FileInfoTypeEnum): - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("name",): { - "max_length": 1024, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "name": (str,), # noqa: E501 - "type": (FileInfoTypeEnum,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - name: str # noqa: E501 - """ - """ - - type: FileInfoTypeEnum # noqa: E501 - """ - """ - - attribute_map = { - "name": "name", # noqa: E501 - "type": "type", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, type, *args, **kwargs): # noqa: E501 - """FileInfo - a model defined in OpenAPI - - Args: - name (str): - type (FileInfoTypeEnum): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.type = type - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, name, type, *args, **kwargs): # noqa: E501 - """FileInfo - a model defined in OpenAPI - - Args: - name (str): - type (FileInfoTypeEnum): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.type = type - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/file_info_type_enum.py b/cvat-sdk/cvat_sdk/model/file_info_type_enum.py deleted file mode 100644 index abd0fbe5..00000000 --- a/cvat-sdk/cvat_sdk/model/file_info_type_enum.py +++ /dev/null @@ -1,309 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class FileInfoTypeEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("value",): { - "REG": "REG", - "DIR": "DIR", - }, - } - - validations = {} - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "value": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """FileInfoTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["REG", "DIR", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["REG", "DIR", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """FileInfoTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["REG", "DIR", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["REG", "DIR", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/cvat-sdk/cvat_sdk/model/frame_meta.py b/cvat-sdk/cvat_sdk/model/frame_meta.py deleted file mode 100644 index 3fea2f96..00000000 --- a/cvat-sdk/cvat_sdk/model/frame_meta.py +++ /dev/null @@ -1,349 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class FrameMeta(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - width (int): - - height (int): - - name (str): - - has_related_context (bool): - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("name",): { - "max_length": 1024, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "width": (int,), # noqa: E501 - "height": (int,), # noqa: E501 - "name": (str,), # noqa: E501 - "has_related_context": (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - width: int # noqa: E501 - """ - """ - - height: int # noqa: E501 - """ - """ - - name: str # noqa: E501 - """ - """ - - has_related_context: bool # noqa: E501 - """ - """ - - attribute_map = { - "width": "width", # noqa: E501 - "height": "height", # noqa: E501 - "name": "name", # noqa: E501 - "has_related_context": "has_related_context", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data( - cls, width, height, name, has_related_context, *args, **kwargs - ): # noqa: E501 - """FrameMeta - a model defined in OpenAPI - - Args: - width (int): - height (int): - name (str): - has_related_context (bool): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.width = width - self.height = height - self.name = name - self.has_related_context = has_related_context - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, width, height, name, has_related_context, *args, **kwargs): # noqa: E501 - """FrameMeta - a model defined in OpenAPI - - Args: - width (int): - height (int): - name (str): - has_related_context (bool): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.width = width - self.height = height - self.name = name - self.has_related_context = has_related_context - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/input_type_enum.py b/cvat-sdk/cvat_sdk/model/input_type_enum.py deleted file mode 100644 index f82853f6..00000000 --- a/cvat-sdk/cvat_sdk/model/input_type_enum.py +++ /dev/null @@ -1,312 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class InputTypeEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("value",): { - "CHECKBOX": "checkbox", - "RADIO": "radio", - "NUMBER": "number", - "TEXT": "text", - "SELECT": "select", - }, - } - - validations = {} - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "value": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """InputTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["checkbox", "radio", "number", "text", "select", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["checkbox", "radio", "number", "text", "select", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """InputTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["checkbox", "radio", "number", "text", "select", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["checkbox", "radio", "number", "text", "select", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/cvat-sdk/cvat_sdk/model/invitation_read.py b/cvat-sdk/cvat_sdk/model/invitation_read.py deleted file mode 100644 index b9ad2a90..00000000 --- a/cvat-sdk/cvat_sdk/model/invitation_read.py +++ /dev/null @@ -1,378 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.basic_user import BasicUser - from cvat_sdk.model.role_enum import RoleEnum - - globals()["BasicUser"] = BasicUser - globals()["RoleEnum"] = RoleEnum - - -class InvitationRead(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - owner (BasicUser): - - role (RoleEnum): - - user (BasicUser): - - organization (int): - - key (str): [optional] # noqa: E501 - - created_date (datetime): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "owner": (BasicUser,), # noqa: E501 - "role": (RoleEnum,), # noqa: E501 - "user": (BasicUser,), # noqa: E501 - "organization": (int,), # noqa: E501 - "key": (str,), # noqa: E501 - "created_date": (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - key: str # noqa: E501 - """ - [optional] - """ - - created_date: datetime # noqa: E501 - """ - [optional] - """ - - owner: BasicUser # noqa: E501 - """ - """ - - role: RoleEnum # noqa: E501 - """ - """ - - user: BasicUser # noqa: E501 - """ - """ - - organization: int # noqa: E501 - """ - """ - - attribute_map = { - "owner": "owner", # noqa: E501 - "role": "role", # noqa: E501 - "user": "user", # noqa: E501 - "organization": "organization", # noqa: E501 - "key": "key", # noqa: E501 - "created_date": "created_date", # noqa: E501 - } - - read_only_vars = { - "key", # noqa: E501 - "created_date", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, owner, role, user, organization, *args, **kwargs): # noqa: E501 - """InvitationRead - a model defined in OpenAPI - - Args: - owner (BasicUser): - role (RoleEnum): - user (BasicUser): - organization (int): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - key (str): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.owner = owner - self.role = role - self.user = user - self.organization = organization - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, owner, role, user, organization, *args, **kwargs): # noqa: E501 - """InvitationRead - a model defined in OpenAPI - - Args: - owner (BasicUser): - role (RoleEnum): - user (BasicUser): - organization (int): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - key (str): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.owner = owner - self.role = role - self.user = user - self.organization = organization - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/invitation_write.py b/cvat-sdk/cvat_sdk/model/invitation_write.py deleted file mode 100644 index 42f79f35..00000000 --- a/cvat-sdk/cvat_sdk/model/invitation_write.py +++ /dev/null @@ -1,376 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.role_enum import RoleEnum - - globals()["RoleEnum"] = RoleEnum - - -class InvitationWrite(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - role (RoleEnum): - - email (str): - - key (str): [optional] # noqa: E501 - - created_date (datetime): [optional] # noqa: E501 - - owner (int): [optional] # noqa: E501 - - organization (int): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "role": (RoleEnum,), # noqa: E501 - "email": (str,), # noqa: E501 - "key": (str,), # noqa: E501 - "created_date": (datetime,), # noqa: E501 - "owner": (int,), # noqa: E501 - "organization": (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - key: str # noqa: E501 - """ - [optional] - """ - - created_date: datetime # noqa: E501 - """ - [optional] - """ - - owner: int # noqa: E501 - """ - [optional] - """ - - role: RoleEnum # noqa: E501 - """ - """ - - organization: int # noqa: E501 - """ - [optional] - """ - - email: str # noqa: E501 - """ - """ - - attribute_map = { - "role": "role", # noqa: E501 - "email": "email", # noqa: E501 - "key": "key", # noqa: E501 - "created_date": "created_date", # noqa: E501 - "owner": "owner", # noqa: E501 - "organization": "organization", # noqa: E501 - } - - read_only_vars = { - "key", # noqa: E501 - "created_date", # noqa: E501 - "owner", # noqa: E501 - "organization", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, role, email, *args, **kwargs): # noqa: E501 - """InvitationWrite - a model defined in OpenAPI - - Args: - role (RoleEnum): - email (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - key (str): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - owner (int): [optional] # noqa: E501 - organization (int): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.role = role - self.email = email - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, role, email, *args, **kwargs): # noqa: E501 - """InvitationWrite - a model defined in OpenAPI - - Args: - role (RoleEnum): - email (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - key (str): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - owner (int): [optional] # noqa: E501 - organization (int): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.role = role - self.email = email - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/invitation_write_request.py b/cvat-sdk/cvat_sdk/model/invitation_write_request.py deleted file mode 100644 index a458ce1c..00000000 --- a/cvat-sdk/cvat_sdk/model/invitation_write_request.py +++ /dev/null @@ -1,331 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.role_enum import RoleEnum - - globals()["RoleEnum"] = RoleEnum - - -class InvitationWriteRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - role (RoleEnum): - - email (str): - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("email",): { - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "role": (RoleEnum,), # noqa: E501 - "email": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - role: RoleEnum # noqa: E501 - """ - """ - - email: str # noqa: E501 - """ - """ - - attribute_map = { - "role": "role", # noqa: E501 - "email": "email", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, role, email, *args, **kwargs): # noqa: E501 - """InvitationWriteRequest - a model defined in OpenAPI - - Args: - role (RoleEnum): - email (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.role = role - self.email = email - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, role, email, *args, **kwargs): # noqa: E501 - """InvitationWriteRequest - a model defined in OpenAPI - - Args: - role (RoleEnum): - email (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.role = role - self.email = email - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/issue_read.py b/cvat-sdk/cvat_sdk/model/issue_read.py deleted file mode 100644 index 594f231e..00000000 --- a/cvat-sdk/cvat_sdk/model/issue_read.py +++ /dev/null @@ -1,426 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.comment_read import CommentRead - from cvat_sdk.model.comment_read_owner import CommentReadOwner - - globals()["CommentRead"] = CommentRead - globals()["CommentReadOwner"] = CommentReadOwner - - -class IssueRead(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - position ([float]): - - comments ([CommentRead]): - - id (int): [optional] # noqa: E501 - - frame (int): [optional] # noqa: E501 - - job (int): [optional] # noqa: E501 - - owner (CommentReadOwner): [optional] # noqa: E501 - - assignee (CommentReadOwner): [optional] # noqa: E501 - - created_date (datetime): [optional] # noqa: E501 - - updated_date (datetime): [optional] # noqa: E501 - - resolved (bool): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "position": ([float],), # noqa: E501 - "comments": ([CommentRead],), # noqa: E501 - "id": (int,), # noqa: E501 - "frame": (int,), # noqa: E501 - "job": (int,), # noqa: E501 - "owner": (CommentReadOwner,), # noqa: E501 - "assignee": (CommentReadOwner,), # noqa: E501 - "created_date": (datetime,), # noqa: E501 - "updated_date": (datetime,), # noqa: E501 - "resolved": (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - id: int # noqa: E501 - """ - [optional] - """ - - frame: int # noqa: E501 - """ - [optional] - """ - - position: typing.List[float] # noqa: E501 - """ - [float] - """ - - job: int # noqa: E501 - """ - [optional] - """ - - owner: CommentReadOwner # noqa: E501 - """ - [optional] - """ - - assignee: CommentReadOwner # noqa: E501 - """ - [optional] - """ - - created_date: datetime # noqa: E501 - """ - [optional] - """ - - updated_date: datetime # noqa: E501 - """ - [optional] - """ - - comments: typing.List[CommentRead] # noqa: E501 - """ - [CommentRead] - """ - - resolved: bool # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "position": "position", # noqa: E501 - "comments": "comments", # noqa: E501 - "id": "id", # noqa: E501 - "frame": "frame", # noqa: E501 - "job": "job", # noqa: E501 - "owner": "owner", # noqa: E501 - "assignee": "assignee", # noqa: E501 - "created_date": "created_date", # noqa: E501 - "updated_date": "updated_date", # noqa: E501 - "resolved": "resolved", # noqa: E501 - } - - read_only_vars = { - "id", # noqa: E501 - "frame", # noqa: E501 - "job", # noqa: E501 - "created_date", # noqa: E501 - "updated_date", # noqa: E501 - "resolved", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, position, comments, *args, **kwargs): # noqa: E501 - """IssueRead - a model defined in OpenAPI - - Args: - position ([float]): - comments ([CommentRead]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - frame (int): [optional] # noqa: E501 - job (int): [optional] # noqa: E501 - owner (CommentReadOwner): [optional] # noqa: E501 - assignee (CommentReadOwner): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - resolved (bool): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.position = position - self.comments = comments - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, position, comments, *args, **kwargs): # noqa: E501 - """IssueRead - a model defined in OpenAPI - - Args: - position ([float]): - comments ([CommentRead]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - frame (int): [optional] # noqa: E501 - job (int): [optional] # noqa: E501 - owner (CommentReadOwner): [optional] # noqa: E501 - assignee (CommentReadOwner): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - resolved (bool): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.position = position - self.comments = comments - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/issue_write.py b/cvat-sdk/cvat_sdk/model/issue_write.py deleted file mode 100644 index d8c88fb0..00000000 --- a/cvat-sdk/cvat_sdk/model/issue_write.py +++ /dev/null @@ -1,418 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class IssueWrite(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - frame (int): - - position ([float]): - - job (int): - - message (str): - - id (int): [optional] # noqa: E501 - - owner (int): [optional] # noqa: E501 - - assignee (int, none_type): [optional] # noqa: E501 - - created_date (datetime): [optional] # noqa: E501 - - updated_date (datetime): [optional] # noqa: E501 - - resolved (bool): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "frame": (int,), # noqa: E501 - "position": ([float],), # noqa: E501 - "job": (int,), # noqa: E501 - "message": (str,), # noqa: E501 - "id": (int,), # noqa: E501 - "owner": (int,), # noqa: E501 - "assignee": ( - int, - none_type, - ), # noqa: E501 - "created_date": (datetime,), # noqa: E501 - "updated_date": (datetime,), # noqa: E501 - "resolved": (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - id: int # noqa: E501 - """ - [optional] - """ - - frame: int # noqa: E501 - """ - """ - - position: typing.List[float] # noqa: E501 - """ - [float] - """ - - job: int # noqa: E501 - """ - """ - - owner: int # noqa: E501 - """ - [optional] - """ - - assignee: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - created_date: datetime # noqa: E501 - """ - [optional] - """ - - updated_date: datetime # noqa: E501 - """ - [optional] - """ - - message: str # noqa: E501 - """ - """ - - resolved: bool # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "frame": "frame", # noqa: E501 - "position": "position", # noqa: E501 - "job": "job", # noqa: E501 - "message": "message", # noqa: E501 - "id": "id", # noqa: E501 - "owner": "owner", # noqa: E501 - "assignee": "assignee", # noqa: E501 - "created_date": "created_date", # noqa: E501 - "updated_date": "updated_date", # noqa: E501 - "resolved": "resolved", # noqa: E501 - } - - read_only_vars = { - "id", # noqa: E501 - "owner", # noqa: E501 - "created_date", # noqa: E501 - "updated_date", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, frame, position, job, message, *args, **kwargs): # noqa: E501 - """IssueWrite - a model defined in OpenAPI - - Args: - frame (int): - position ([float]): - job (int): - message (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - owner (int): [optional] # noqa: E501 - assignee (int, none_type): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - resolved (bool): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.frame = frame - self.position = position - self.job = job - self.message = message - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, frame, position, job, message, *args, **kwargs): # noqa: E501 - """IssueWrite - a model defined in OpenAPI - - Args: - frame (int): - position ([float]): - job (int): - message (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - owner (int): [optional] # noqa: E501 - assignee (int, none_type): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - resolved (bool): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.frame = frame - self.position = position - self.job = job - self.message = message - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/issue_write_request.py b/cvat-sdk/cvat_sdk/model/issue_write_request.py deleted file mode 100644 index c6e14e04..00000000 --- a/cvat-sdk/cvat_sdk/model/issue_write_request.py +++ /dev/null @@ -1,373 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class IssueWriteRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - frame (int): - - position ([float]): - - job (int): - - message (str): - - assignee (int, none_type): [optional] # noqa: E501 - - resolved (bool): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("message",): { - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "frame": (int,), # noqa: E501 - "position": ([float],), # noqa: E501 - "job": (int,), # noqa: E501 - "message": (str,), # noqa: E501 - "assignee": ( - int, - none_type, - ), # noqa: E501 - "resolved": (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - frame: int # noqa: E501 - """ - """ - - position: typing.List[float] # noqa: E501 - """ - [float] - """ - - job: int # noqa: E501 - """ - """ - - assignee: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - message: str # noqa: E501 - """ - """ - - resolved: bool # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "frame": "frame", # noqa: E501 - "position": "position", # noqa: E501 - "job": "job", # noqa: E501 - "message": "message", # noqa: E501 - "assignee": "assignee", # noqa: E501 - "resolved": "resolved", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, frame, position, job, message, *args, **kwargs): # noqa: E501 - """IssueWriteRequest - a model defined in OpenAPI - - Args: - frame (int): - position ([float]): - job (int): - message (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - assignee (int, none_type): [optional] # noqa: E501 - resolved (bool): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.frame = frame - self.position = position - self.job = job - self.message = message - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, frame, position, job, message, *args, **kwargs): # noqa: E501 - """IssueWriteRequest - a model defined in OpenAPI - - Args: - frame (int): - position ([float]): - job (int): - message (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - assignee (int, none_type): [optional] # noqa: E501 - resolved (bool): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.frame = frame - self.position = position - self.job = job - self.message = message - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/job_commit.py b/cvat-sdk/cvat_sdk/model/job_commit.py deleted file mode 100644 index 6675aa44..00000000 --- a/cvat-sdk/cvat_sdk/model/job_commit.py +++ /dev/null @@ -1,359 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class JobCommit(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - id (int): [optional] # noqa: E501 - - owner (int, none_type): [optional] # noqa: E501 - - data ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - - timestamp (datetime): [optional] # noqa: E501 - - scope (str): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("scope",): { - "max_length": 32, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "id": (int,), # noqa: E501 - "owner": ( - int, - none_type, - ), # noqa: E501 - "data": ( - {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, - ), # noqa: E501 - "timestamp": (datetime,), # noqa: E501 - "scope": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - id: int # noqa: E501 - """ - [optional] - """ - - owner: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - data: typing.Dict[str, typing.Union[typing.Any, none_type]] # noqa: E501 - """ - [optional] - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - timestamp: datetime # noqa: E501 - """ - [optional] - """ - - scope: str # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "id": "id", # noqa: E501 - "owner": "owner", # noqa: E501 - "data": "data", # noqa: E501 - "timestamp": "timestamp", # noqa: E501 - "scope": "scope", # noqa: E501 - } - - read_only_vars = { - "id", # noqa: E501 - "timestamp", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """JobCommit - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - owner (int, none_type): [optional] # noqa: E501 - data ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - timestamp (datetime): [optional] # noqa: E501 - scope (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """JobCommit - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - owner (int, none_type): [optional] # noqa: E501 - data ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - timestamp (datetime): [optional] # noqa: E501 - scope (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/job_read.py b/cvat-sdk/cvat_sdk/model/job_read.py deleted file mode 100644 index 58969c39..00000000 --- a/cvat-sdk/cvat_sdk/model/job_read.py +++ /dev/null @@ -1,577 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.chunk_type import ChunkType - from cvat_sdk.model.comment_read_owner import CommentReadOwner - from cvat_sdk.model.job_stage import JobStage - from cvat_sdk.model.job_status import JobStatus - from cvat_sdk.model.label import Label - from cvat_sdk.model.operation_status import OperationStatus - - globals()["ChunkType"] = ChunkType - globals()["CommentReadOwner"] = CommentReadOwner - globals()["JobStage"] = JobStage - globals()["JobStatus"] = JobStatus - globals()["Label"] = Label - globals()["OperationStatus"] = OperationStatus - - -class JobRead(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - assignee (CommentReadOwner): - - dimension (str): - - labels ([Label]): - - bug_tracker (str, none_type): - - url (str): [optional] # noqa: E501 - - id (int): [optional] # noqa: E501 - - task_id (int): [optional] # noqa: E501 - - project_id (int, none_type): [optional] # noqa: E501 - - status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - - stage (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - - state (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - - mode (str): [optional] # noqa: E501 - - start_frame (int): [optional] # noqa: E501 - - stop_frame (int): [optional] # noqa: E501 - - data_chunk_size (int, none_type): [optional] # noqa: E501 - - data_compressed_chunk_type (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - - updated_date (datetime): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("dimension",): { - "max_length": 2, - }, - ("bug_tracker",): { - "max_length": 2000, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "assignee": (CommentReadOwner,), # noqa: E501 - "dimension": (str,), # noqa: E501 - "labels": ([Label],), # noqa: E501 - "bug_tracker": ( - str, - none_type, - ), # noqa: E501 - "url": (str,), # noqa: E501 - "id": (int,), # noqa: E501 - "task_id": (int,), # noqa: E501 - "project_id": ( - int, - none_type, - ), # noqa: E501 - "status": ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ), # noqa: E501 - "stage": ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ), # noqa: E501 - "state": ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ), # noqa: E501 - "mode": (str,), # noqa: E501 - "start_frame": (int,), # noqa: E501 - "stop_frame": (int,), # noqa: E501 - "data_chunk_size": ( - int, - none_type, - ), # noqa: E501 - "data_compressed_chunk_type": ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ), # noqa: E501 - "updated_date": (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - url: str # noqa: E501 - """ - [optional] - """ - - id: int # noqa: E501 - """ - [optional] - """ - - task_id: int # noqa: E501 - """ - [optional] - """ - - project_id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - assignee: CommentReadOwner # noqa: E501 - """ - """ - - dimension: str # noqa: E501 - """ - """ - - labels: typing.List[Label] # noqa: E501 - """ - [Label] - """ - - bug_tracker: typing.Union[str, none_type] # noqa: E501 - """ - """ - - status: typing.Union[typing.Any, none_type] # noqa: E501 - """ - [optional] - """ - - stage: typing.Union[typing.Any, none_type] # noqa: E501 - """ - [optional] - """ - - state: typing.Union[typing.Any, none_type] # noqa: E501 - """ - [optional] - """ - - mode: str # noqa: E501 - """ - [optional] - """ - - start_frame: int # noqa: E501 - """ - [optional] - """ - - stop_frame: int # noqa: E501 - """ - [optional] - """ - - data_chunk_size: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - data_compressed_chunk_type: typing.Union[typing.Any, none_type] # noqa: E501 - """ - [optional] - """ - - updated_date: datetime # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "assignee": "assignee", # noqa: E501 - "dimension": "dimension", # noqa: E501 - "labels": "labels", # noqa: E501 - "bug_tracker": "bug_tracker", # noqa: E501 - "url": "url", # noqa: E501 - "id": "id", # noqa: E501 - "task_id": "task_id", # noqa: E501 - "project_id": "project_id", # noqa: E501 - "status": "status", # noqa: E501 - "stage": "stage", # noqa: E501 - "state": "state", # noqa: E501 - "mode": "mode", # noqa: E501 - "start_frame": "start_frame", # noqa: E501 - "stop_frame": "stop_frame", # noqa: E501 - "data_chunk_size": "data_chunk_size", # noqa: E501 - "data_compressed_chunk_type": "data_compressed_chunk_type", # noqa: E501 - "updated_date": "updated_date", # noqa: E501 - } - - read_only_vars = { - "url", # noqa: E501 - "id", # noqa: E501 - "task_id", # noqa: E501 - "project_id", # noqa: E501 - "status", # noqa: E501 - "stage", # noqa: E501 - "state", # noqa: E501 - "mode", # noqa: E501 - "start_frame", # noqa: E501 - "stop_frame", # noqa: E501 - "data_chunk_size", # noqa: E501 - "data_compressed_chunk_type", # noqa: E501 - "updated_date", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data( - cls, assignee, dimension, labels, bug_tracker, *args, **kwargs - ): # noqa: E501 - """JobRead - a model defined in OpenAPI - - Args: - assignee (CommentReadOwner): - dimension (str): - labels ([Label]): - bug_tracker (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - task_id (int): [optional] # noqa: E501 - project_id (int, none_type): [optional] # noqa: E501 - status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - stage (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - state (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - mode (str): [optional] # noqa: E501 - start_frame (int): [optional] # noqa: E501 - stop_frame (int): [optional] # noqa: E501 - data_chunk_size (int, none_type): [optional] # noqa: E501 - data_compressed_chunk_type (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.assignee = assignee - self.dimension = dimension - self.labels = labels - self.bug_tracker = bug_tracker - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, assignee, dimension, labels, bug_tracker, *args, **kwargs): # noqa: E501 - """JobRead - a model defined in OpenAPI - - Args: - assignee (CommentReadOwner): - dimension (str): - labels ([Label]): - bug_tracker (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - task_id (int): [optional] # noqa: E501 - project_id (int, none_type): [optional] # noqa: E501 - status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - stage (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - state (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - mode (str): [optional] # noqa: E501 - start_frame (int): [optional] # noqa: E501 - stop_frame (int): [optional] # noqa: E501 - data_chunk_size (int, none_type): [optional] # noqa: E501 - data_compressed_chunk_type (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.assignee = assignee - self.dimension = dimension - self.labels = labels - self.bug_tracker = bug_tracker - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/job_stage.py b/cvat-sdk/cvat_sdk/model/job_stage.py deleted file mode 100644 index 5d3c0341..00000000 --- a/cvat-sdk/cvat_sdk/model/job_stage.py +++ /dev/null @@ -1,310 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class JobStage(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("value",): { - "ANNOTATION": "annotation", - "VALIDATION": "validation", - "ACCEPTANCE": "acceptance", - }, - } - - validations = {} - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "value": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """JobStage - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["annotation", "validation", "acceptance", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["annotation", "validation", "acceptance", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """JobStage - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["annotation", "validation", "acceptance", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["annotation", "validation", "acceptance", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/cvat-sdk/cvat_sdk/model/job_status.py b/cvat-sdk/cvat_sdk/model/job_status.py deleted file mode 100644 index 5bf6329a..00000000 --- a/cvat-sdk/cvat_sdk/model/job_status.py +++ /dev/null @@ -1,310 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class JobStatus(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("value",): { - "ANNOTATION": "annotation", - "VALIDATION": "validation", - "COMPLETED": "completed", - }, - } - - validations = {} - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "value": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """JobStatus - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["annotation", "validation", "completed", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["annotation", "validation", "completed", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """JobStatus - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["annotation", "validation", "completed", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["annotation", "validation", "completed", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/cvat-sdk/cvat_sdk/model/job_write.py b/cvat-sdk/cvat_sdk/model/job_write.py deleted file mode 100644 index 6f84cb13..00000000 --- a/cvat-sdk/cvat_sdk/model/job_write.py +++ /dev/null @@ -1,337 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.job_stage import JobStage - from cvat_sdk.model.operation_status import OperationStatus - - globals()["JobStage"] = JobStage - globals()["OperationStatus"] = OperationStatus - - -class JobWrite(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - assignee (int, none_type): [optional] # noqa: E501 - - stage (JobStage): [optional] # noqa: E501 - - state (OperationStatus): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "assignee": ( - int, - none_type, - ), # noqa: E501 - "stage": (JobStage,), # noqa: E501 - "state": (OperationStatus,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - assignee: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - stage: JobStage # noqa: E501 - """ - [optional] - """ - - state: OperationStatus # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "assignee": "assignee", # noqa: E501 - "stage": "stage", # noqa: E501 - "state": "state", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """JobWrite - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - assignee (int, none_type): [optional] # noqa: E501 - stage (JobStage): [optional] # noqa: E501 - state (OperationStatus): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """JobWrite - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - assignee (int, none_type): [optional] # noqa: E501 - stage (JobStage): [optional] # noqa: E501 - state (OperationStatus): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/job_write_request.py b/cvat-sdk/cvat_sdk/model/job_write_request.py deleted file mode 100644 index 7ba9b96d..00000000 --- a/cvat-sdk/cvat_sdk/model/job_write_request.py +++ /dev/null @@ -1,337 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.job_stage import JobStage - from cvat_sdk.model.operation_status import OperationStatus - - globals()["JobStage"] = JobStage - globals()["OperationStatus"] = OperationStatus - - -class JobWriteRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - assignee (int, none_type): [optional] # noqa: E501 - - stage (JobStage): [optional] # noqa: E501 - - state (OperationStatus): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "assignee": ( - int, - none_type, - ), # noqa: E501 - "stage": (JobStage,), # noqa: E501 - "state": (OperationStatus,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - assignee: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - stage: JobStage # noqa: E501 - """ - [optional] - """ - - state: OperationStatus # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "assignee": "assignee", # noqa: E501 - "stage": "stage", # noqa: E501 - "state": "state", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """JobWriteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - assignee (int, none_type): [optional] # noqa: E501 - stage (JobStage): [optional] # noqa: E501 - state (OperationStatus): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """JobWriteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - assignee (int, none_type): [optional] # noqa: E501 - stage (JobStage): [optional] # noqa: E501 - state (OperationStatus): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/label.py b/cvat-sdk/cvat_sdk/model/label.py deleted file mode 100644 index db074cef..00000000 --- a/cvat-sdk/cvat_sdk/model/label.py +++ /dev/null @@ -1,365 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.attribute import Attribute - - globals()["Attribute"] = Attribute - - -class Label(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - name (str): - - id (int): [optional] # noqa: E501 - - color (str): [optional] # noqa: E501 - - attributes ([Attribute]): [optional] if omitted the server will use the default value of [] # noqa: E501 - - deleted (bool): Delete label if value is true from proper Task/Project object. [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("name",): { - "max_length": 64, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "name": (str,), # noqa: E501 - "id": (int,), # noqa: E501 - "color": (str,), # noqa: E501 - "attributes": ([Attribute],), # noqa: E501 - "deleted": (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - id: int # noqa: E501 - """ - [optional] - """ - - name: str # noqa: E501 - """ - """ - - color: str # noqa: E501 - """ - [optional] - """ - - attributes: typing.List[Attribute] # noqa: E501 - """ - [optional, default: []] - [Attribute] - """ - - deleted: bool # noqa: E501 - """ - [optional] - Delete label if value is true from proper Task/Project object. - """ - - attribute_map = { - "name": "name", # noqa: E501 - "id": "id", # noqa: E501 - "color": "color", # noqa: E501 - "attributes": "attributes", # noqa: E501 - "deleted": "deleted", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 - """Label - a model defined in OpenAPI - - Args: - name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - color (str): [optional] # noqa: E501 - attributes ([Attribute]): [optional] if omitted the server will use the default value of [] # noqa: E501 - deleted (bool): Delete label if value is true from proper Task/Project object. [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, name, *args, **kwargs): # noqa: E501 - """Label - a model defined in OpenAPI - - Args: - name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - color (str): [optional] # noqa: E501 - attributes ([Attribute]): [optional] if omitted the server will use the default value of [] # noqa: E501 - deleted (bool): Delete label if value is true from proper Task/Project object. [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/labeled_data.py b/cvat-sdk/cvat_sdk/model/labeled_data.py deleted file mode 100644 index a2b3cb7e..00000000 --- a/cvat-sdk/cvat_sdk/model/labeled_data.py +++ /dev/null @@ -1,358 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.labeled_image import LabeledImage - from cvat_sdk.model.labeled_shape import LabeledShape - from cvat_sdk.model.labeled_track import LabeledTrack - - globals()["LabeledImage"] = LabeledImage - globals()["LabeledShape"] = LabeledShape - globals()["LabeledTrack"] = LabeledTrack - - -class LabeledData(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - version (int): - - tags ([LabeledImage]): - - shapes ([LabeledShape]): - - tracks ([LabeledTrack]): - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "version": (int,), # noqa: E501 - "tags": ([LabeledImage],), # noqa: E501 - "shapes": ([LabeledShape],), # noqa: E501 - "tracks": ([LabeledTrack],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - version: int # noqa: E501 - """ - """ - - tags: typing.List[LabeledImage] # noqa: E501 - """ - [LabeledImage] - """ - - shapes: typing.List[LabeledShape] # noqa: E501 - """ - [LabeledShape] - """ - - tracks: typing.List[LabeledTrack] # noqa: E501 - """ - [LabeledTrack] - """ - - attribute_map = { - "version": "version", # noqa: E501 - "tags": "tags", # noqa: E501 - "shapes": "shapes", # noqa: E501 - "tracks": "tracks", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, version, tags, shapes, tracks, *args, **kwargs): # noqa: E501 - """LabeledData - a model defined in OpenAPI - - Args: - version (int): - tags ([LabeledImage]): - shapes ([LabeledShape]): - tracks ([LabeledTrack]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.version = version - self.tags = tags - self.shapes = shapes - self.tracks = tracks - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, version, tags, shapes, tracks, *args, **kwargs): # noqa: E501 - """LabeledData - a model defined in OpenAPI - - Args: - version (int): - tags ([LabeledImage]): - shapes ([LabeledShape]): - tracks ([LabeledTrack]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.version = version - self.tags = tags - self.shapes = shapes - self.tracks = tracks - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/labeled_image.py b/cvat-sdk/cvat_sdk/model/labeled_image.py deleted file mode 100644 index 81095ac8..00000000 --- a/cvat-sdk/cvat_sdk/model/labeled_image.py +++ /dev/null @@ -1,390 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.attribute_val import AttributeVal - - globals()["AttributeVal"] = AttributeVal - - -class LabeledImage(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - frame (int): - - label_id (int): - - group (int, none_type): - - attributes ([AttributeVal]): - - id (int, none_type): [optional] # noqa: E501 - - source (str): [optional] if omitted the server will use the default value of "manual" # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("frame",): { - "inclusive_minimum": 0, - }, - ("label_id",): { - "inclusive_minimum": 0, - }, - ("group",): { - "inclusive_minimum": 0, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "frame": (int,), # noqa: E501 - "label_id": (int,), # noqa: E501 - "group": ( - int, - none_type, - ), # noqa: E501 - "attributes": ([AttributeVal],), # noqa: E501 - "id": ( - int, - none_type, - ), # noqa: E501 - "source": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - frame: int # noqa: E501 - """ - """ - - label_id: int # noqa: E501 - """ - """ - - group: typing.Union[int, none_type] # noqa: E501 - """ - """ - - source: str # noqa: E501 - """ - [optional, default: "manual"] - """ - - attributes: typing.List[AttributeVal] # noqa: E501 - """ - [AttributeVal] - """ - - attribute_map = { - "frame": "frame", # noqa: E501 - "label_id": "label_id", # noqa: E501 - "group": "group", # noqa: E501 - "attributes": "attributes", # noqa: E501 - "id": "id", # noqa: E501 - "source": "source", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, frame, label_id, group, attributes, *args, **kwargs): # noqa: E501 - """LabeledImage - a model defined in OpenAPI - - Args: - frame (int): - label_id (int): - group (int, none_type): - attributes ([AttributeVal]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int, none_type): [optional] # noqa: E501 - source (str): [optional] if omitted the server will use the default value of "manual" # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.frame = frame - self.label_id = label_id - self.group = group - self.attributes = attributes - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, frame, label_id, group, attributes, *args, **kwargs): # noqa: E501 - """LabeledImage - a model defined in OpenAPI - - Args: - frame (int): - label_id (int): - group (int, none_type): - attributes ([AttributeVal]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int, none_type): [optional] # noqa: E501 - source (str): [optional] if omitted the server will use the default value of "manual" # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.frame = frame - self.label_id = label_id - self.group = group - self.attributes = attributes - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/labeled_shape.py b/cvat-sdk/cvat_sdk/model/labeled_shape.py deleted file mode 100644 index 764337d6..00000000 --- a/cvat-sdk/cvat_sdk/model/labeled_shape.py +++ /dev/null @@ -1,459 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.attribute_val import AttributeVal - from cvat_sdk.model.shape_type import ShapeType - - globals()["AttributeVal"] = AttributeVal - globals()["ShapeType"] = ShapeType - - -class LabeledShape(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - type (ShapeType): - - occluded (bool): - - points ([float]): - - frame (int): - - label_id (int): - - group (int, none_type): - - attributes ([AttributeVal]): - - z_order (int): [optional] if omitted the server will use the default value of 0 # noqa: E501 - - rotation (float): [optional] if omitted the server will use the default value of 0.0 # noqa: E501 - - id (int, none_type): [optional] # noqa: E501 - - source (str): [optional] if omitted the server will use the default value of "manual" # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("frame",): { - "inclusive_minimum": 0, - }, - ("label_id",): { - "inclusive_minimum": 0, - }, - ("group",): { - "inclusive_minimum": 0, - }, - ("rotation",): { - "inclusive_maximum": 360, - "inclusive_minimum": 0, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "type": (ShapeType,), # noqa: E501 - "occluded": (bool,), # noqa: E501 - "points": ([float],), # noqa: E501 - "frame": (int,), # noqa: E501 - "label_id": (int,), # noqa: E501 - "group": ( - int, - none_type, - ), # noqa: E501 - "attributes": ([AttributeVal],), # noqa: E501 - "z_order": (int,), # noqa: E501 - "rotation": (float,), # noqa: E501 - "id": ( - int, - none_type, - ), # noqa: E501 - "source": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - type: ShapeType # noqa: E501 - """ - """ - - occluded: bool # noqa: E501 - """ - """ - - z_order: int # noqa: E501 - """ - [optional, default: 0] - """ - - rotation: float # noqa: E501 - """ - [optional, default: 0.0] - """ - - points: typing.List[float] # noqa: E501 - """ - [float] - """ - - id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - frame: int # noqa: E501 - """ - """ - - label_id: int # noqa: E501 - """ - """ - - group: typing.Union[int, none_type] # noqa: E501 - """ - """ - - source: str # noqa: E501 - """ - [optional, default: "manual"] - """ - - attributes: typing.List[AttributeVal] # noqa: E501 - """ - [AttributeVal] - """ - - attribute_map = { - "type": "type", # noqa: E501 - "occluded": "occluded", # noqa: E501 - "points": "points", # noqa: E501 - "frame": "frame", # noqa: E501 - "label_id": "label_id", # noqa: E501 - "group": "group", # noqa: E501 - "attributes": "attributes", # noqa: E501 - "z_order": "z_order", # noqa: E501 - "rotation": "rotation", # noqa: E501 - "id": "id", # noqa: E501 - "source": "source", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data( - cls, type, occluded, points, frame, label_id, group, attributes, *args, **kwargs - ): # noqa: E501 - """LabeledShape - a model defined in OpenAPI - - Args: - type (ShapeType): - occluded (bool): - points ([float]): - frame (int): - label_id (int): - group (int, none_type): - attributes ([AttributeVal]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - z_order (int): [optional] if omitted the server will use the default value of 0 # noqa: E501 - rotation (float): [optional] if omitted the server will use the default value of 0.0 # noqa: E501 - id (int, none_type): [optional] # noqa: E501 - source (str): [optional] if omitted the server will use the default value of "manual" # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - self.occluded = occluded - self.points = points - self.frame = frame - self.label_id = label_id - self.group = group - self.attributes = attributes - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__( - self, type, occluded, points, frame, label_id, group, attributes, *args, **kwargs - ): # noqa: E501 - """LabeledShape - a model defined in OpenAPI - - Args: - type (ShapeType): - occluded (bool): - points ([float]): - frame (int): - label_id (int): - group (int, none_type): - attributes ([AttributeVal]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - z_order (int): [optional] if omitted the server will use the default value of 0 # noqa: E501 - rotation (float): [optional] if omitted the server will use the default value of 0.0 # noqa: E501 - id (int, none_type): [optional] # noqa: E501 - source (str): [optional] if omitted the server will use the default value of "manual" # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - self.occluded = occluded - self.points = points - self.frame = frame - self.label_id = label_id - self.group = group - self.attributes = attributes - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/labeled_track.py b/cvat-sdk/cvat_sdk/model/labeled_track.py deleted file mode 100644 index 278f0380..00000000 --- a/cvat-sdk/cvat_sdk/model/labeled_track.py +++ /dev/null @@ -1,407 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.attribute_val import AttributeVal - from cvat_sdk.model.tracked_shape import TrackedShape - - globals()["AttributeVal"] = AttributeVal - globals()["TrackedShape"] = TrackedShape - - -class LabeledTrack(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - frame (int): - - label_id (int): - - group (int, none_type): - - shapes ([TrackedShape]): - - attributes ([AttributeVal]): - - id (int, none_type): [optional] # noqa: E501 - - source (str): [optional] if omitted the server will use the default value of "manual" # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("frame",): { - "inclusive_minimum": 0, - }, - ("label_id",): { - "inclusive_minimum": 0, - }, - ("group",): { - "inclusive_minimum": 0, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "frame": (int,), # noqa: E501 - "label_id": (int,), # noqa: E501 - "group": ( - int, - none_type, - ), # noqa: E501 - "shapes": ([TrackedShape],), # noqa: E501 - "attributes": ([AttributeVal],), # noqa: E501 - "id": ( - int, - none_type, - ), # noqa: E501 - "source": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - frame: int # noqa: E501 - """ - """ - - label_id: int # noqa: E501 - """ - """ - - group: typing.Union[int, none_type] # noqa: E501 - """ - """ - - source: str # noqa: E501 - """ - [optional, default: "manual"] - """ - - shapes: typing.List[TrackedShape] # noqa: E501 - """ - [TrackedShape] - """ - - attributes: typing.List[AttributeVal] # noqa: E501 - """ - [AttributeVal] - """ - - attribute_map = { - "frame": "frame", # noqa: E501 - "label_id": "label_id", # noqa: E501 - "group": "group", # noqa: E501 - "shapes": "shapes", # noqa: E501 - "attributes": "attributes", # noqa: E501 - "id": "id", # noqa: E501 - "source": "source", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data( - cls, frame, label_id, group, shapes, attributes, *args, **kwargs - ): # noqa: E501 - """LabeledTrack - a model defined in OpenAPI - - Args: - frame (int): - label_id (int): - group (int, none_type): - shapes ([TrackedShape]): - attributes ([AttributeVal]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int, none_type): [optional] # noqa: E501 - source (str): [optional] if omitted the server will use the default value of "manual" # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.frame = frame - self.label_id = label_id - self.group = group - self.shapes = shapes - self.attributes = attributes - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, frame, label_id, group, shapes, attributes, *args, **kwargs): # noqa: E501 - """LabeledTrack - a model defined in OpenAPI - - Args: - frame (int): - label_id (int): - group (int, none_type): - shapes ([TrackedShape]): - attributes ([AttributeVal]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int, none_type): [optional] # noqa: E501 - source (str): [optional] if omitted the server will use the default value of "manual" # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.frame = frame - self.label_id = label_id - self.group = group - self.shapes = shapes - self.attributes = attributes - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/location_enum.py b/cvat-sdk/cvat_sdk/model/location_enum.py deleted file mode 100644 index ad2f8fbb..00000000 --- a/cvat-sdk/cvat_sdk/model/location_enum.py +++ /dev/null @@ -1,309 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class LocationEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("value",): { - "CLOUD_STORAGE": "cloud_storage", - "LOCAL": "local", - }, - } - - validations = {} - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "value": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """LocationEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["cloud_storage", "local", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["cloud_storage", "local", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """LocationEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["cloud_storage", "local", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["cloud_storage", "local", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/cvat-sdk/cvat_sdk/model/log_event.py b/cvat-sdk/cvat_sdk/model/log_event.py deleted file mode 100644 index e9de8512..00000000 --- a/cvat-sdk/cvat_sdk/model/log_event.py +++ /dev/null @@ -1,408 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class LogEvent(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - client_id (int): - - name (str): - - time (datetime): - - is_active (bool): - - job_id (int): [optional] # noqa: E501 - - task_id (int): [optional] # noqa: E501 - - proj_id (int): [optional] # noqa: E501 - - message (str): [optional] # noqa: E501 - - payload ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("name",): { - "max_length": 64, - }, - ("message",): { - "max_length": 4096, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "client_id": (int,), # noqa: E501 - "name": (str,), # noqa: E501 - "time": (datetime,), # noqa: E501 - "is_active": (bool,), # noqa: E501 - "job_id": (int,), # noqa: E501 - "task_id": (int,), # noqa: E501 - "proj_id": (int,), # noqa: E501 - "message": (str,), # noqa: E501 - "payload": ( - {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, - ), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - job_id: int # noqa: E501 - """ - [optional] - """ - - task_id: int # noqa: E501 - """ - [optional] - """ - - proj_id: int # noqa: E501 - """ - [optional] - """ - - client_id: int # noqa: E501 - """ - """ - - name: str # noqa: E501 - """ - """ - - time: datetime # noqa: E501 - """ - """ - - message: str # noqa: E501 - """ - [optional] - """ - - payload: typing.Dict[str, typing.Union[typing.Any, none_type]] # noqa: E501 - """ - [optional] - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - is_active: bool # noqa: E501 - """ - """ - - attribute_map = { - "client_id": "client_id", # noqa: E501 - "name": "name", # noqa: E501 - "time": "time", # noqa: E501 - "is_active": "is_active", # noqa: E501 - "job_id": "job_id", # noqa: E501 - "task_id": "task_id", # noqa: E501 - "proj_id": "proj_id", # noqa: E501 - "message": "message", # noqa: E501 - "payload": "payload", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, client_id, name, time, is_active, *args, **kwargs): # noqa: E501 - """LogEvent - a model defined in OpenAPI - - Args: - client_id (int): - name (str): - time (datetime): - is_active (bool): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - job_id (int): [optional] # noqa: E501 - task_id (int): [optional] # noqa: E501 - proj_id (int): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - payload ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - self.name = name - self.time = time - self.is_active = is_active - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, client_id, name, time, is_active, *args, **kwargs): # noqa: E501 - """LogEvent - a model defined in OpenAPI - - Args: - client_id (int): - name (str): - time (datetime): - is_active (bool): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - job_id (int): [optional] # noqa: E501 - task_id (int): [optional] # noqa: E501 - proj_id (int): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - payload ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - self.name = name - self.time = time - self.is_active = is_active - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/log_event_request.py b/cvat-sdk/cvat_sdk/model/log_event_request.py deleted file mode 100644 index 505e46ce..00000000 --- a/cvat-sdk/cvat_sdk/model/log_event_request.py +++ /dev/null @@ -1,410 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class LogEventRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - client_id (int): - - name (str): - - time (datetime): - - is_active (bool): - - job_id (int): [optional] # noqa: E501 - - task_id (int): [optional] # noqa: E501 - - proj_id (int): [optional] # noqa: E501 - - message (str): [optional] # noqa: E501 - - payload ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("name",): { - "max_length": 64, - "min_length": 1, - }, - ("message",): { - "max_length": 4096, - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "client_id": (int,), # noqa: E501 - "name": (str,), # noqa: E501 - "time": (datetime,), # noqa: E501 - "is_active": (bool,), # noqa: E501 - "job_id": (int,), # noqa: E501 - "task_id": (int,), # noqa: E501 - "proj_id": (int,), # noqa: E501 - "message": (str,), # noqa: E501 - "payload": ( - {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, - ), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - job_id: int # noqa: E501 - """ - [optional] - """ - - task_id: int # noqa: E501 - """ - [optional] - """ - - proj_id: int # noqa: E501 - """ - [optional] - """ - - client_id: int # noqa: E501 - """ - """ - - name: str # noqa: E501 - """ - """ - - time: datetime # noqa: E501 - """ - """ - - message: str # noqa: E501 - """ - [optional] - """ - - payload: typing.Dict[str, typing.Union[typing.Any, none_type]] # noqa: E501 - """ - [optional] - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - is_active: bool # noqa: E501 - """ - """ - - attribute_map = { - "client_id": "client_id", # noqa: E501 - "name": "name", # noqa: E501 - "time": "time", # noqa: E501 - "is_active": "is_active", # noqa: E501 - "job_id": "job_id", # noqa: E501 - "task_id": "task_id", # noqa: E501 - "proj_id": "proj_id", # noqa: E501 - "message": "message", # noqa: E501 - "payload": "payload", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, client_id, name, time, is_active, *args, **kwargs): # noqa: E501 - """LogEventRequest - a model defined in OpenAPI - - Args: - client_id (int): - name (str): - time (datetime): - is_active (bool): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - job_id (int): [optional] # noqa: E501 - task_id (int): [optional] # noqa: E501 - proj_id (int): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - payload ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - self.name = name - self.time = time - self.is_active = is_active - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, client_id, name, time, is_active, *args, **kwargs): # noqa: E501 - """LogEventRequest - a model defined in OpenAPI - - Args: - client_id (int): - name (str): - time (datetime): - is_active (bool): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - job_id (int): [optional] # noqa: E501 - task_id (int): [optional] # noqa: E501 - proj_id (int): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - payload ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - self.name = name - self.time = time - self.is_active = is_active - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/login_request.py b/cvat-sdk/cvat_sdk/model/login_request.py deleted file mode 100644 index 2b904a8e..00000000 --- a/cvat-sdk/cvat_sdk/model/login_request.py +++ /dev/null @@ -1,333 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class LoginRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - password (str): - - username (str): [optional] # noqa: E501 - - email (str): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("password",): { - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "password": (str,), # noqa: E501 - "username": (str,), # noqa: E501 - "email": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - username: str # noqa: E501 - """ - [optional] - """ - - email: str # noqa: E501 - """ - [optional] - """ - - password: str # noqa: E501 - """ - """ - - attribute_map = { - "password": "password", # noqa: E501 - "username": "username", # noqa: E501 - "email": "email", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, password, *args, **kwargs): # noqa: E501 - """LoginRequest - a model defined in OpenAPI - - Args: - password (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - username (str): [optional] # noqa: E501 - email (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.password = password - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, password, *args, **kwargs): # noqa: E501 - """LoginRequest - a model defined in OpenAPI - - Args: - password (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - username (str): [optional] # noqa: E501 - email (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.password = password - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/manifest.py b/cvat-sdk/cvat_sdk/model/manifest.py deleted file mode 100644 index 5d356ebb..00000000 --- a/cvat-sdk/cvat_sdk/model/manifest.py +++ /dev/null @@ -1,306 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class Manifest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - filename (str): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("filename",): { - "max_length": 1024, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "filename": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - filename: str # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "filename": "filename", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Manifest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - filename (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Manifest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - filename (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/manifest_request.py b/cvat-sdk/cvat_sdk/model/manifest_request.py deleted file mode 100644 index 3f97b394..00000000 --- a/cvat-sdk/cvat_sdk/model/manifest_request.py +++ /dev/null @@ -1,307 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class ManifestRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - filename (str): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("filename",): { - "max_length": 1024, - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "filename": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - filename: str # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "filename": "filename", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ManifestRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - filename (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ManifestRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - filename (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/membership_read.py b/cvat-sdk/cvat_sdk/model/membership_read.py deleted file mode 100644 index 1394c2f5..00000000 --- a/cvat-sdk/cvat_sdk/model/membership_read.py +++ /dev/null @@ -1,400 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.basic_user import BasicUser - from cvat_sdk.model.role_enum import RoleEnum - - globals()["BasicUser"] = BasicUser - globals()["RoleEnum"] = RoleEnum - - -class MembershipRead(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - user (BasicUser): - - id (int): [optional] # noqa: E501 - - organization (int): [optional] # noqa: E501 - - is_active (bool): [optional] # noqa: E501 - - joined_date (datetime): [optional] # noqa: E501 - - role (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - - invitation (str): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "user": (BasicUser,), # noqa: E501 - "id": (int,), # noqa: E501 - "organization": (int,), # noqa: E501 - "is_active": (bool,), # noqa: E501 - "joined_date": (datetime,), # noqa: E501 - "role": ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ), # noqa: E501 - "invitation": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - id: int # noqa: E501 - """ - [optional] - """ - - user: BasicUser # noqa: E501 - """ - """ - - organization: int # noqa: E501 - """ - [optional] - """ - - is_active: bool # noqa: E501 - """ - [optional] - """ - - joined_date: datetime # noqa: E501 - """ - [optional] - """ - - role: typing.Union[typing.Any, none_type] # noqa: E501 - """ - [optional] - """ - - invitation: str # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "user": "user", # noqa: E501 - "id": "id", # noqa: E501 - "organization": "organization", # noqa: E501 - "is_active": "is_active", # noqa: E501 - "joined_date": "joined_date", # noqa: E501 - "role": "role", # noqa: E501 - "invitation": "invitation", # noqa: E501 - } - - read_only_vars = { - "id", # noqa: E501 - "organization", # noqa: E501 - "is_active", # noqa: E501 - "joined_date", # noqa: E501 - "role", # noqa: E501 - "invitation", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, user, *args, **kwargs): # noqa: E501 - """MembershipRead - a model defined in OpenAPI - - Args: - user (BasicUser): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - organization (int): [optional] # noqa: E501 - is_active (bool): [optional] # noqa: E501 - joined_date (datetime): [optional] # noqa: E501 - role (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - invitation (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.user = user - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, user, *args, **kwargs): # noqa: E501 - """MembershipRead - a model defined in OpenAPI - - Args: - user (BasicUser): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - organization (int): [optional] # noqa: E501 - is_active (bool): [optional] # noqa: E501 - joined_date (datetime): [optional] # noqa: E501 - role (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - invitation (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.user = user - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/membership_write.py b/cvat-sdk/cvat_sdk/model/membership_write.py deleted file mode 100644 index 3b4f1492..00000000 --- a/cvat-sdk/cvat_sdk/model/membership_write.py +++ /dev/null @@ -1,376 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.role_enum import RoleEnum - - globals()["RoleEnum"] = RoleEnum - - -class MembershipWrite(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - role (RoleEnum): - - id (int): [optional] # noqa: E501 - - user (int): [optional] # noqa: E501 - - organization (int): [optional] # noqa: E501 - - is_active (bool): [optional] # noqa: E501 - - joined_date (datetime): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "role": (RoleEnum,), # noqa: E501 - "id": (int,), # noqa: E501 - "user": (int,), # noqa: E501 - "organization": (int,), # noqa: E501 - "is_active": (bool,), # noqa: E501 - "joined_date": (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - id: int # noqa: E501 - """ - [optional] - """ - - user: int # noqa: E501 - """ - [optional] - """ - - organization: int # noqa: E501 - """ - [optional] - """ - - is_active: bool # noqa: E501 - """ - [optional] - """ - - joined_date: datetime # noqa: E501 - """ - [optional] - """ - - role: RoleEnum # noqa: E501 - """ - """ - - attribute_map = { - "role": "role", # noqa: E501 - "id": "id", # noqa: E501 - "user": "user", # noqa: E501 - "organization": "organization", # noqa: E501 - "is_active": "is_active", # noqa: E501 - "joined_date": "joined_date", # noqa: E501 - } - - read_only_vars = { - "id", # noqa: E501 - "user", # noqa: E501 - "organization", # noqa: E501 - "is_active", # noqa: E501 - "joined_date", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, role, *args, **kwargs): # noqa: E501 - """MembershipWrite - a model defined in OpenAPI - - Args: - role (RoleEnum): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - user (int): [optional] # noqa: E501 - organization (int): [optional] # noqa: E501 - is_active (bool): [optional] # noqa: E501 - joined_date (datetime): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.role = role - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, role, *args, **kwargs): # noqa: E501 - """MembershipWrite - a model defined in OpenAPI - - Args: - role (RoleEnum): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - user (int): [optional] # noqa: E501 - organization (int): [optional] # noqa: E501 - is_active (bool): [optional] # noqa: E501 - joined_date (datetime): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.role = role - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/meta_user.py b/cvat-sdk/cvat_sdk/model/meta_user.py deleted file mode 100644 index 73b44f5e..00000000 --- a/cvat-sdk/cvat_sdk/model/meta_user.py +++ /dev/null @@ -1,493 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.basic_user import BasicUser - from cvat_sdk.model.user import User - - globals()["BasicUser"] = BasicUser - globals()["User"] = User - - -class MetaUser(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = { - ("username",): { - "max_length": 150, - "regex": { - "pattern": r"^[\w.@+-]+$", # noqa: E501 - }, - }, - ("first_name",): { - "max_length": 150, - }, - ("last_name",): { - "max_length": 150, - }, - ("email",): { - "max_length": 254, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "username": (str,), # noqa: E501 - "url": (str,), # noqa: E501 - "id": (int,), # noqa: E501 - "first_name": (str,), # noqa: E501 - "last_name": (str,), # noqa: E501 - "email": (str,), # noqa: E501 - "is_staff": (bool,), # noqa: E501 - "is_superuser": (bool,), # noqa: E501 - "is_active": (bool,), # noqa: E501 - "last_login": (datetime,), # noqa: E501 - "date_joined": (datetime,), # noqa: E501 - "groups": ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - "BasicUser": BasicUser, - "None": BasicUser, - "User": User, - } - if not val: - return None - return {"username": val} - - # member type declarations - url: str # noqa: E501 - """ - [optional] - """ - - id: int # noqa: E501 - """ - [optional] - """ - - username: str # noqa: E501 - """ - Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.. - """ - - first_name: str # noqa: E501 - """ - [optional] - """ - - last_name: str # noqa: E501 - """ - [optional] - """ - - email: str # noqa: E501 - """ - [optional] - """ - - groups: typing.List[str] # noqa: E501 - """ - [str] - """ - - is_staff: bool # noqa: E501 - """ - [optional] - Designates whether the user can log into this admin site.. - """ - - is_superuser: bool # noqa: E501 - """ - [optional] - Designates that this user has all permissions without explicitly assigning them.. - """ - - is_active: bool # noqa: E501 - """ - [optional] - Designates whether this user should be treated as active. Unselect this instead of deleting accounts.. - """ - - last_login: datetime # noqa: E501 - """ - [optional] - """ - - date_joined: datetime # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "username": "username", # noqa: E501 - "url": "url", # noqa: E501 - "id": "id", # noqa: E501 - "first_name": "first_name", # noqa: E501 - "last_name": "last_name", # noqa: E501 - "email": "email", # noqa: E501 - "is_staff": "is_staff", # noqa: E501 - "is_superuser": "is_superuser", # noqa: E501 - "is_active": "is_active", # noqa: E501 - "last_login": "last_login", # noqa: E501 - "date_joined": "date_joined", # noqa: E501 - "groups": "groups", # noqa: E501 - } - - read_only_vars = { - "url", # noqa: E501 - "id", # noqa: E501 - "last_login", # noqa: E501 - "date_joined", # noqa: E501 - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, username, *args, **kwargs) -> MetaUser: # noqa: E501 - """MetaUser - a model defined in OpenAPI - - Keyword Args: - username (str): Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - email (str): [optional] # noqa: E501 - is_staff (bool): Designates whether the user can log into this admin site.. [optional] # noqa: E501 - is_superuser (bool): Designates that this user has all permissions without explicitly assigning them.. [optional] # noqa: E501 - is_active (bool): Designates whether this user should be treated as active. Unselect this instead of deleting accounts.. [optional] # noqa: E501 - last_login (datetime): [optional] # noqa: E501 - date_joined (datetime): [optional] # noqa: E501 - groups ([str]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - "_check_type": _check_type, - "_path_to_item": _path_to_item, - "_spec_property_naming": _spec_property_naming, - "_configuration": _configuration, - "_visited_composed_classes": self._visited_composed_classes, - } - required_args = { - "username": username, - } - kwargs.update(required_args) - composed_info = validate_get_composed_info(constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if ( - var_name in discarded_args - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self._additional_properties_model_instances - ): - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - "_composed_instances", - "_var_name_to_model_instances", - "_additional_properties_model_instances", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, username, *args, **kwargs): # noqa: E501 - """MetaUser - a model defined in OpenAPI - - Keyword Args: - username (str): Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - email (str): [optional] # noqa: E501 - is_staff (bool): Designates whether the user can log into this admin site.. [optional] # noqa: E501 - is_superuser (bool): Designates that this user has all permissions without explicitly assigning them.. [optional] # noqa: E501 - is_active (bool): Designates whether this user should be treated as active. Unselect this instead of deleting accounts.. [optional] # noqa: E501 - last_login (datetime): [optional] # noqa: E501 - date_joined (datetime): [optional] # noqa: E501 - groups ([str]): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - "_check_type": _check_type, - "_path_to_item": _path_to_item, - "_spec_property_naming": _spec_property_naming, - "_configuration": _configuration, - "_visited_composed_classes": self._visited_composed_classes, - } - required_args = { - "username": username, - } - kwargs.update(required_args) - composed_info = validate_get_composed_info(constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if ( - var_name in discarded_args - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self._additional_properties_model_instances - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - "anyOf": [], - "allOf": [], - "oneOf": [ - BasicUser, - User, - ], - } diff --git a/cvat-sdk/cvat_sdk/model/operation_status.py b/cvat-sdk/cvat_sdk/model/operation_status.py deleted file mode 100644 index 4fb351da..00000000 --- a/cvat-sdk/cvat_sdk/model/operation_status.py +++ /dev/null @@ -1,311 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class OperationStatus(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("value",): { - "NEW": "new", - "IN_PROGRESS": "in progress", - "COMPLETED": "completed", - "REJECTED": "rejected", - }, - } - - validations = {} - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "value": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """OperationStatus - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["new", "in progress", "completed", "rejected", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["new", "in progress", "completed", "rejected", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """OperationStatus - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["new", "in progress", "completed", "rejected", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["new", "in progress", "completed", "rejected", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/cvat-sdk/cvat_sdk/model/organization_read.py b/cvat-sdk/cvat_sdk/model/organization_read.py deleted file mode 100644 index 13149104..00000000 --- a/cvat-sdk/cvat_sdk/model/organization_read.py +++ /dev/null @@ -1,409 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.basic_user import BasicUser - - globals()["BasicUser"] = BasicUser - - -class OrganizationRead(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - owner (BasicUser): - - id (int): [optional] # noqa: E501 - - slug (str): [optional] # noqa: E501 - - name (str): [optional] # noqa: E501 - - description (str): [optional] # noqa: E501 - - created_date (datetime): [optional] # noqa: E501 - - updated_date (datetime): [optional] # noqa: E501 - - contact ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("slug",): { - "regex": { - "pattern": r"^[-a-zA-Z0-9_]+$", # noqa: E501 - }, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "owner": (BasicUser,), # noqa: E501 - "id": (int,), # noqa: E501 - "slug": (str,), # noqa: E501 - "name": (str,), # noqa: E501 - "description": (str,), # noqa: E501 - "created_date": (datetime,), # noqa: E501 - "updated_date": (datetime,), # noqa: E501 - "contact": ( - {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, - ), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - id: int # noqa: E501 - """ - [optional] - """ - - slug: str # noqa: E501 - """ - [optional] - """ - - name: str # noqa: E501 - """ - [optional] - """ - - description: str # noqa: E501 - """ - [optional] - """ - - created_date: datetime # noqa: E501 - """ - [optional] - """ - - updated_date: datetime # noqa: E501 - """ - [optional] - """ - - contact: typing.Dict[str, typing.Union[typing.Any, none_type]] # noqa: E501 - """ - [optional] - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - owner: BasicUser # noqa: E501 - """ - """ - - attribute_map = { - "owner": "owner", # noqa: E501 - "id": "id", # noqa: E501 - "slug": "slug", # noqa: E501 - "name": "name", # noqa: E501 - "description": "description", # noqa: E501 - "created_date": "created_date", # noqa: E501 - "updated_date": "updated_date", # noqa: E501 - "contact": "contact", # noqa: E501 - } - - read_only_vars = { - "id", # noqa: E501 - "slug", # noqa: E501 - "name", # noqa: E501 - "description", # noqa: E501 - "created_date", # noqa: E501 - "updated_date", # noqa: E501 - "contact", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, owner, *args, **kwargs): # noqa: E501 - """OrganizationRead - a model defined in OpenAPI - - Args: - owner (BasicUser): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - slug (str): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - description (str): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - contact ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.owner = owner - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, owner, *args, **kwargs): # noqa: E501 - """OrganizationRead - a model defined in OpenAPI - - Args: - owner (BasicUser): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - slug (str): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - description (str): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - contact ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.owner = owner - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/organization_write.py b/cvat-sdk/cvat_sdk/model/organization_write.py deleted file mode 100644 index f8aa2c0d..00000000 --- a/cvat-sdk/cvat_sdk/model/organization_write.py +++ /dev/null @@ -1,402 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class OrganizationWrite(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - slug (str): - - id (int): [optional] # noqa: E501 - - name (str): [optional] # noqa: E501 - - description (str): [optional] # noqa: E501 - - created_date (datetime): [optional] # noqa: E501 - - updated_date (datetime): [optional] # noqa: E501 - - contact ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - - owner (int): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("slug",): { - "max_length": 16, - "regex": { - "pattern": r"^[-a-zA-Z0-9_]+$", # noqa: E501 - }, - }, - ("name",): { - "max_length": 64, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "slug": (str,), # noqa: E501 - "id": (int,), # noqa: E501 - "name": (str,), # noqa: E501 - "description": (str,), # noqa: E501 - "created_date": (datetime,), # noqa: E501 - "updated_date": (datetime,), # noqa: E501 - "contact": ( - {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, - ), # noqa: E501 - "owner": (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - id: int # noqa: E501 - """ - [optional] - """ - - slug: str # noqa: E501 - """ - """ - - name: str # noqa: E501 - """ - [optional] - """ - - description: str # noqa: E501 - """ - [optional] - """ - - created_date: datetime # noqa: E501 - """ - [optional] - """ - - updated_date: datetime # noqa: E501 - """ - [optional] - """ - - contact: typing.Dict[str, typing.Union[typing.Any, none_type]] # noqa: E501 - """ - [optional] - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - owner: int # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "slug": "slug", # noqa: E501 - "id": "id", # noqa: E501 - "name": "name", # noqa: E501 - "description": "description", # noqa: E501 - "created_date": "created_date", # noqa: E501 - "updated_date": "updated_date", # noqa: E501 - "contact": "contact", # noqa: E501 - "owner": "owner", # noqa: E501 - } - - read_only_vars = { - "id", # noqa: E501 - "created_date", # noqa: E501 - "updated_date", # noqa: E501 - "owner", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, slug, *args, **kwargs): # noqa: E501 - """OrganizationWrite - a model defined in OpenAPI - - Args: - slug (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - description (str): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - contact ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - owner (int): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.slug = slug - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, slug, *args, **kwargs): # noqa: E501 - """OrganizationWrite - a model defined in OpenAPI - - Args: - slug (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - description (str): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - contact ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - owner (int): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.slug = slug - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/organization_write_request.py b/cvat-sdk/cvat_sdk/model/organization_write_request.py deleted file mode 100644 index 554f8dac..00000000 --- a/cvat-sdk/cvat_sdk/model/organization_write_request.py +++ /dev/null @@ -1,354 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class OrganizationWriteRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - slug (str): - - name (str): [optional] # noqa: E501 - - description (str): [optional] # noqa: E501 - - contact ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("slug",): { - "max_length": 16, - "min_length": 1, - "regex": { - "pattern": r"^[-a-zA-Z0-9_]+$", # noqa: E501 - }, - }, - ("name",): { - "max_length": 64, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "slug": (str,), # noqa: E501 - "name": (str,), # noqa: E501 - "description": (str,), # noqa: E501 - "contact": ( - {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, - ), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - slug: str # noqa: E501 - """ - """ - - name: str # noqa: E501 - """ - [optional] - """ - - description: str # noqa: E501 - """ - [optional] - """ - - contact: typing.Dict[str, typing.Union[typing.Any, none_type]] # noqa: E501 - """ - [optional] - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - attribute_map = { - "slug": "slug", # noqa: E501 - "name": "name", # noqa: E501 - "description": "description", # noqa: E501 - "contact": "contact", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, slug, *args, **kwargs): # noqa: E501 - """OrganizationWriteRequest - a model defined in OpenAPI - - Args: - slug (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - description (str): [optional] # noqa: E501 - contact ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.slug = slug - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, slug, *args, **kwargs): # noqa: E501 - """OrganizationWriteRequest - a model defined in OpenAPI - - Args: - slug (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - description (str): [optional] # noqa: E501 - contact ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.slug = slug - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/paginated_cloud_storage_read_list.py b/cvat-sdk/cvat_sdk/model/paginated_cloud_storage_read_list.py deleted file mode 100644 index a79e4a57..00000000 --- a/cvat-sdk/cvat_sdk/model/paginated_cloud_storage_read_list.py +++ /dev/null @@ -1,350 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.cloud_storage_read import CloudStorageRead - - globals()["CloudStorageRead"] = CloudStorageRead - - -class PaginatedCloudStorageReadList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - count (int): [optional] # noqa: E501 - - next (str, none_type): [optional] # noqa: E501 - - previous (str, none_type): [optional] # noqa: E501 - - results ([CloudStorageRead]): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "count": (int,), # noqa: E501 - "next": ( - str, - none_type, - ), # noqa: E501 - "previous": ( - str, - none_type, - ), # noqa: E501 - "results": ([CloudStorageRead],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - count: int # noqa: E501 - """ - [optional] - """ - - next: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - previous: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - results: typing.List[CloudStorageRead] # noqa: E501 - """ - [optional] - [CloudStorageRead] - """ - - attribute_map = { - "count": "count", # noqa: E501 - "next": "next", # noqa: E501 - "previous": "previous", # noqa: E501 - "results": "results", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PaginatedCloudStorageReadList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - count (int): [optional] # noqa: E501 - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [optional] # noqa: E501 - results ([CloudStorageRead]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PaginatedCloudStorageReadList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - count (int): [optional] # noqa: E501 - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [optional] # noqa: E501 - results ([CloudStorageRead]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/paginated_comment_read_list.py b/cvat-sdk/cvat_sdk/model/paginated_comment_read_list.py deleted file mode 100644 index 598d02b0..00000000 --- a/cvat-sdk/cvat_sdk/model/paginated_comment_read_list.py +++ /dev/null @@ -1,350 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.comment_read import CommentRead - - globals()["CommentRead"] = CommentRead - - -class PaginatedCommentReadList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - count (int): [optional] # noqa: E501 - - next (str, none_type): [optional] # noqa: E501 - - previous (str, none_type): [optional] # noqa: E501 - - results ([CommentRead]): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "count": (int,), # noqa: E501 - "next": ( - str, - none_type, - ), # noqa: E501 - "previous": ( - str, - none_type, - ), # noqa: E501 - "results": ([CommentRead],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - count: int # noqa: E501 - """ - [optional] - """ - - next: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - previous: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - results: typing.List[CommentRead] # noqa: E501 - """ - [optional] - [CommentRead] - """ - - attribute_map = { - "count": "count", # noqa: E501 - "next": "next", # noqa: E501 - "previous": "previous", # noqa: E501 - "results": "results", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PaginatedCommentReadList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - count (int): [optional] # noqa: E501 - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [optional] # noqa: E501 - results ([CommentRead]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PaginatedCommentReadList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - count (int): [optional] # noqa: E501 - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [optional] # noqa: E501 - results ([CommentRead]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/paginated_invitation_read_list.py b/cvat-sdk/cvat_sdk/model/paginated_invitation_read_list.py deleted file mode 100644 index 0201240f..00000000 --- a/cvat-sdk/cvat_sdk/model/paginated_invitation_read_list.py +++ /dev/null @@ -1,350 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.invitation_read import InvitationRead - - globals()["InvitationRead"] = InvitationRead - - -class PaginatedInvitationReadList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - count (int): [optional] # noqa: E501 - - next (str, none_type): [optional] # noqa: E501 - - previous (str, none_type): [optional] # noqa: E501 - - results ([InvitationRead]): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "count": (int,), # noqa: E501 - "next": ( - str, - none_type, - ), # noqa: E501 - "previous": ( - str, - none_type, - ), # noqa: E501 - "results": ([InvitationRead],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - count: int # noqa: E501 - """ - [optional] - """ - - next: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - previous: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - results: typing.List[InvitationRead] # noqa: E501 - """ - [optional] - [InvitationRead] - """ - - attribute_map = { - "count": "count", # noqa: E501 - "next": "next", # noqa: E501 - "previous": "previous", # noqa: E501 - "results": "results", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PaginatedInvitationReadList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - count (int): [optional] # noqa: E501 - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [optional] # noqa: E501 - results ([InvitationRead]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PaginatedInvitationReadList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - count (int): [optional] # noqa: E501 - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [optional] # noqa: E501 - results ([InvitationRead]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/paginated_issue_read_list.py b/cvat-sdk/cvat_sdk/model/paginated_issue_read_list.py deleted file mode 100644 index d9c83954..00000000 --- a/cvat-sdk/cvat_sdk/model/paginated_issue_read_list.py +++ /dev/null @@ -1,350 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.issue_read import IssueRead - - globals()["IssueRead"] = IssueRead - - -class PaginatedIssueReadList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - count (int): [optional] # noqa: E501 - - next (str, none_type): [optional] # noqa: E501 - - previous (str, none_type): [optional] # noqa: E501 - - results ([IssueRead]): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "count": (int,), # noqa: E501 - "next": ( - str, - none_type, - ), # noqa: E501 - "previous": ( - str, - none_type, - ), # noqa: E501 - "results": ([IssueRead],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - count: int # noqa: E501 - """ - [optional] - """ - - next: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - previous: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - results: typing.List[IssueRead] # noqa: E501 - """ - [optional] - [IssueRead] - """ - - attribute_map = { - "count": "count", # noqa: E501 - "next": "next", # noqa: E501 - "previous": "previous", # noqa: E501 - "results": "results", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PaginatedIssueReadList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - count (int): [optional] # noqa: E501 - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [optional] # noqa: E501 - results ([IssueRead]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PaginatedIssueReadList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - count (int): [optional] # noqa: E501 - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [optional] # noqa: E501 - results ([IssueRead]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/paginated_job_commit_list.py b/cvat-sdk/cvat_sdk/model/paginated_job_commit_list.py deleted file mode 100644 index 0abd3c2e..00000000 --- a/cvat-sdk/cvat_sdk/model/paginated_job_commit_list.py +++ /dev/null @@ -1,350 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.job_commit import JobCommit - - globals()["JobCommit"] = JobCommit - - -class PaginatedJobCommitList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - count (int): [optional] # noqa: E501 - - next (str, none_type): [optional] # noqa: E501 - - previous (str, none_type): [optional] # noqa: E501 - - results ([JobCommit]): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "count": (int,), # noqa: E501 - "next": ( - str, - none_type, - ), # noqa: E501 - "previous": ( - str, - none_type, - ), # noqa: E501 - "results": ([JobCommit],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - count: int # noqa: E501 - """ - [optional] - """ - - next: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - previous: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - results: typing.List[JobCommit] # noqa: E501 - """ - [optional] - [JobCommit] - """ - - attribute_map = { - "count": "count", # noqa: E501 - "next": "next", # noqa: E501 - "previous": "previous", # noqa: E501 - "results": "results", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PaginatedJobCommitList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - count (int): [optional] # noqa: E501 - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [optional] # noqa: E501 - results ([JobCommit]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PaginatedJobCommitList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - count (int): [optional] # noqa: E501 - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [optional] # noqa: E501 - results ([JobCommit]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/paginated_job_read_list.py b/cvat-sdk/cvat_sdk/model/paginated_job_read_list.py deleted file mode 100644 index d5b0d5a1..00000000 --- a/cvat-sdk/cvat_sdk/model/paginated_job_read_list.py +++ /dev/null @@ -1,350 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.job_read import JobRead - - globals()["JobRead"] = JobRead - - -class PaginatedJobReadList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - count (int): [optional] # noqa: E501 - - next (str, none_type): [optional] # noqa: E501 - - previous (str, none_type): [optional] # noqa: E501 - - results ([JobRead]): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "count": (int,), # noqa: E501 - "next": ( - str, - none_type, - ), # noqa: E501 - "previous": ( - str, - none_type, - ), # noqa: E501 - "results": ([JobRead],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - count: int # noqa: E501 - """ - [optional] - """ - - next: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - previous: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - results: typing.List[JobRead] # noqa: E501 - """ - [optional] - [JobRead] - """ - - attribute_map = { - "count": "count", # noqa: E501 - "next": "next", # noqa: E501 - "previous": "previous", # noqa: E501 - "results": "results", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PaginatedJobReadList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - count (int): [optional] # noqa: E501 - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [optional] # noqa: E501 - results ([JobRead]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PaginatedJobReadList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - count (int): [optional] # noqa: E501 - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [optional] # noqa: E501 - results ([JobRead]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/paginated_membership_read_list.py b/cvat-sdk/cvat_sdk/model/paginated_membership_read_list.py deleted file mode 100644 index dfe3aa79..00000000 --- a/cvat-sdk/cvat_sdk/model/paginated_membership_read_list.py +++ /dev/null @@ -1,350 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.membership_read import MembershipRead - - globals()["MembershipRead"] = MembershipRead - - -class PaginatedMembershipReadList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - count (int): [optional] # noqa: E501 - - next (str, none_type): [optional] # noqa: E501 - - previous (str, none_type): [optional] # noqa: E501 - - results ([MembershipRead]): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "count": (int,), # noqa: E501 - "next": ( - str, - none_type, - ), # noqa: E501 - "previous": ( - str, - none_type, - ), # noqa: E501 - "results": ([MembershipRead],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - count: int # noqa: E501 - """ - [optional] - """ - - next: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - previous: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - results: typing.List[MembershipRead] # noqa: E501 - """ - [optional] - [MembershipRead] - """ - - attribute_map = { - "count": "count", # noqa: E501 - "next": "next", # noqa: E501 - "previous": "previous", # noqa: E501 - "results": "results", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PaginatedMembershipReadList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - count (int): [optional] # noqa: E501 - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [optional] # noqa: E501 - results ([MembershipRead]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PaginatedMembershipReadList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - count (int): [optional] # noqa: E501 - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [optional] # noqa: E501 - results ([MembershipRead]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/paginated_meta_user_list.py b/cvat-sdk/cvat_sdk/model/paginated_meta_user_list.py deleted file mode 100644 index f3aa3e13..00000000 --- a/cvat-sdk/cvat_sdk/model/paginated_meta_user_list.py +++ /dev/null @@ -1,350 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.meta_user import MetaUser - - globals()["MetaUser"] = MetaUser - - -class PaginatedMetaUserList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - count (int): [optional] # noqa: E501 - - next (str, none_type): [optional] # noqa: E501 - - previous (str, none_type): [optional] # noqa: E501 - - results ([MetaUser]): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "count": (int,), # noqa: E501 - "next": ( - str, - none_type, - ), # noqa: E501 - "previous": ( - str, - none_type, - ), # noqa: E501 - "results": ([MetaUser],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - count: int # noqa: E501 - """ - [optional] - """ - - next: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - previous: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - results: typing.List[MetaUser] # noqa: E501 - """ - [optional] - [MetaUser] - """ - - attribute_map = { - "count": "count", # noqa: E501 - "next": "next", # noqa: E501 - "previous": "previous", # noqa: E501 - "results": "results", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PaginatedMetaUserList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - count (int): [optional] # noqa: E501 - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [optional] # noqa: E501 - results ([MetaUser]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PaginatedMetaUserList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - count (int): [optional] # noqa: E501 - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [optional] # noqa: E501 - results ([MetaUser]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/paginated_polymorphic_project_list.py b/cvat-sdk/cvat_sdk/model/paginated_polymorphic_project_list.py deleted file mode 100644 index 459f7604..00000000 --- a/cvat-sdk/cvat_sdk/model/paginated_polymorphic_project_list.py +++ /dev/null @@ -1,350 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.polymorphic_project import PolymorphicProject - - globals()["PolymorphicProject"] = PolymorphicProject - - -class PaginatedPolymorphicProjectList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - count (int): [optional] # noqa: E501 - - next (str, none_type): [optional] # noqa: E501 - - previous (str, none_type): [optional] # noqa: E501 - - results ([PolymorphicProject]): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "count": (int,), # noqa: E501 - "next": ( - str, - none_type, - ), # noqa: E501 - "previous": ( - str, - none_type, - ), # noqa: E501 - "results": ([PolymorphicProject],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - count: int # noqa: E501 - """ - [optional] - """ - - next: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - previous: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - results: typing.List[PolymorphicProject] # noqa: E501 - """ - [optional] - [PolymorphicProject] - """ - - attribute_map = { - "count": "count", # noqa: E501 - "next": "next", # noqa: E501 - "previous": "previous", # noqa: E501 - "results": "results", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PaginatedPolymorphicProjectList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - count (int): [optional] # noqa: E501 - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [optional] # noqa: E501 - results ([PolymorphicProject]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PaginatedPolymorphicProjectList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - count (int): [optional] # noqa: E501 - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [optional] # noqa: E501 - results ([PolymorphicProject]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/paginated_task_read_list.py b/cvat-sdk/cvat_sdk/model/paginated_task_read_list.py deleted file mode 100644 index 9e9be1f3..00000000 --- a/cvat-sdk/cvat_sdk/model/paginated_task_read_list.py +++ /dev/null @@ -1,350 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.task_read import TaskRead - - globals()["TaskRead"] = TaskRead - - -class PaginatedTaskReadList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - count (int): [optional] # noqa: E501 - - next (str, none_type): [optional] # noqa: E501 - - previous (str, none_type): [optional] # noqa: E501 - - results ([TaskRead]): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "count": (int,), # noqa: E501 - "next": ( - str, - none_type, - ), # noqa: E501 - "previous": ( - str, - none_type, - ), # noqa: E501 - "results": ([TaskRead],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - count: int # noqa: E501 - """ - [optional] - """ - - next: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - previous: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - results: typing.List[TaskRead] # noqa: E501 - """ - [optional] - [TaskRead] - """ - - attribute_map = { - "count": "count", # noqa: E501 - "next": "next", # noqa: E501 - "previous": "previous", # noqa: E501 - "results": "results", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PaginatedTaskReadList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - count (int): [optional] # noqa: E501 - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [optional] # noqa: E501 - results ([TaskRead]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PaginatedTaskReadList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - count (int): [optional] # noqa: E501 - next (str, none_type): [optional] # noqa: E501 - previous (str, none_type): [optional] # noqa: E501 - results ([TaskRead]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/password_change_request.py b/cvat-sdk/cvat_sdk/model/password_change_request.py deleted file mode 100644 index 21a7c59d..00000000 --- a/cvat-sdk/cvat_sdk/model/password_change_request.py +++ /dev/null @@ -1,346 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class PasswordChangeRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - old_password (str): - - new_password1 (str): - - new_password2 (str): - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("old_password",): { - "max_length": 128, - "min_length": 1, - }, - ("new_password1",): { - "max_length": 128, - "min_length": 1, - }, - ("new_password2",): { - "max_length": 128, - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "old_password": (str,), # noqa: E501 - "new_password1": (str,), # noqa: E501 - "new_password2": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - old_password: str # noqa: E501 - """ - """ - - new_password1: str # noqa: E501 - """ - """ - - new_password2: str # noqa: E501 - """ - """ - - attribute_map = { - "old_password": "old_password", # noqa: E501 - "new_password1": "new_password1", # noqa: E501 - "new_password2": "new_password2", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data( - cls, old_password, new_password1, new_password2, *args, **kwargs - ): # noqa: E501 - """PasswordChangeRequest - a model defined in OpenAPI - - Args: - old_password (str): - new_password1 (str): - new_password2 (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.old_password = old_password - self.new_password1 = new_password1 - self.new_password2 = new_password2 - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, old_password, new_password1, new_password2, *args, **kwargs): # noqa: E501 - """PasswordChangeRequest - a model defined in OpenAPI - - Args: - old_password (str): - new_password1 (str): - new_password2 (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.old_password = old_password - self.new_password1 = new_password1 - self.new_password2 = new_password2 - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/password_reset_confirm_request.py b/cvat-sdk/cvat_sdk/model/password_reset_confirm_request.py deleted file mode 100644 index 1b6bc08c..00000000 --- a/cvat-sdk/cvat_sdk/model/password_reset_confirm_request.py +++ /dev/null @@ -1,360 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class PasswordResetConfirmRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - new_password1 (str): - - new_password2 (str): - - uid (str): - - token (str): - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("new_password1",): { - "max_length": 128, - "min_length": 1, - }, - ("new_password2",): { - "max_length": 128, - "min_length": 1, - }, - ("uid",): { - "min_length": 1, - }, - ("token",): { - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "new_password1": (str,), # noqa: E501 - "new_password2": (str,), # noqa: E501 - "uid": (str,), # noqa: E501 - "token": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - new_password1: str # noqa: E501 - """ - """ - - new_password2: str # noqa: E501 - """ - """ - - uid: str # noqa: E501 - """ - """ - - token: str # noqa: E501 - """ - """ - - attribute_map = { - "new_password1": "new_password1", # noqa: E501 - "new_password2": "new_password2", # noqa: E501 - "uid": "uid", # noqa: E501 - "token": "token", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data( - cls, new_password1, new_password2, uid, token, *args, **kwargs - ): # noqa: E501 - """PasswordResetConfirmRequest - a model defined in OpenAPI - - Args: - new_password1 (str): - new_password2 (str): - uid (str): - token (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.new_password1 = new_password1 - self.new_password2 = new_password2 - self.uid = uid - self.token = token - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, new_password1, new_password2, uid, token, *args, **kwargs): # noqa: E501 - """PasswordResetConfirmRequest - a model defined in OpenAPI - - Args: - new_password1 (str): - new_password2 (str): - uid (str): - token (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.new_password1 = new_password1 - self.new_password2 = new_password2 - self.uid = uid - self.token = token - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/password_reset_serializer_ex_request.py b/cvat-sdk/cvat_sdk/model/password_reset_serializer_ex_request.py deleted file mode 100644 index 5f102d27..00000000 --- a/cvat-sdk/cvat_sdk/model/password_reset_serializer_ex_request.py +++ /dev/null @@ -1,311 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class PasswordResetSerializerExRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - email (str): - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("email",): { - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "email": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - email: str # noqa: E501 - """ - """ - - attribute_map = { - "email": "email", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, email, *args, **kwargs): # noqa: E501 - """PasswordResetSerializerExRequest - a model defined in OpenAPI - - Args: - email (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email = email - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, email, *args, **kwargs): # noqa: E501 - """PasswordResetSerializerExRequest - a model defined in OpenAPI - - Args: - email (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email = email - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/patched_cloud_storage_write_request.py b/cvat-sdk/cvat_sdk/model/patched_cloud_storage_write_request.py deleted file mode 100644 index 6c58b6f0..00000000 --- a/cvat-sdk/cvat_sdk/model/patched_cloud_storage_write_request.py +++ /dev/null @@ -1,473 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.basic_user_request import BasicUserRequest - from cvat_sdk.model.credentials_type_enum import CredentialsTypeEnum - from cvat_sdk.model.manifest_request import ManifestRequest - from cvat_sdk.model.provider_type_enum import ProviderTypeEnum - - globals()["BasicUserRequest"] = BasicUserRequest - globals()["CredentialsTypeEnum"] = CredentialsTypeEnum - globals()["ManifestRequest"] = ManifestRequest - globals()["ProviderTypeEnum"] = ProviderTypeEnum - - -class PatchedCloudStorageWriteRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - provider_type (ProviderTypeEnum): [optional] # noqa: E501 - - resource (str): [optional] # noqa: E501 - - display_name (str): [optional] # noqa: E501 - - owner (BasicUserRequest): [optional] # noqa: E501 - - credentials_type (CredentialsTypeEnum): [optional] # noqa: E501 - - session_token (str): [optional] # noqa: E501 - - account_name (str): [optional] # noqa: E501 - - key (str): [optional] # noqa: E501 - - secret_key (str): [optional] # noqa: E501 - - key_file (file_type): [optional] # noqa: E501 - - specific_attributes (str): [optional] # noqa: E501 - - description (str): [optional] # noqa: E501 - - manifests ([ManifestRequest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("resource",): { - "max_length": 222, - "min_length": 1, - }, - ("display_name",): { - "max_length": 63, - "min_length": 1, - }, - ("session_token",): { - "max_length": 440, - }, - ("account_name",): { - "max_length": 24, - }, - ("key",): { - "max_length": 20, - }, - ("secret_key",): { - "max_length": 40, - }, - ("specific_attributes",): { - "max_length": 1024, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "provider_type": (ProviderTypeEnum,), # noqa: E501 - "resource": (str,), # noqa: E501 - "display_name": (str,), # noqa: E501 - "owner": (BasicUserRequest,), # noqa: E501 - "credentials_type": (CredentialsTypeEnum,), # noqa: E501 - "session_token": (str,), # noqa: E501 - "account_name": (str,), # noqa: E501 - "key": (str,), # noqa: E501 - "secret_key": (str,), # noqa: E501 - "key_file": (file_type,), # noqa: E501 - "specific_attributes": (str,), # noqa: E501 - "description": (str,), # noqa: E501 - "manifests": ([ManifestRequest],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - provider_type: ProviderTypeEnum # noqa: E501 - """ - [optional] - """ - - resource: str # noqa: E501 - """ - [optional] - """ - - display_name: str # noqa: E501 - """ - [optional] - """ - - owner: BasicUserRequest # noqa: E501 - """ - [optional] - """ - - credentials_type: CredentialsTypeEnum # noqa: E501 - """ - [optional] - """ - - session_token: str # noqa: E501 - """ - [optional] - """ - - account_name: str # noqa: E501 - """ - [optional] - """ - - key: str # noqa: E501 - """ - [optional] - """ - - secret_key: str # noqa: E501 - """ - [optional] - """ - - key_file: file_type # noqa: E501 - """ - [optional] - """ - - specific_attributes: str # noqa: E501 - """ - [optional] - """ - - description: str # noqa: E501 - """ - [optional] - """ - - manifests: typing.List[ManifestRequest] # noqa: E501 - """ - [optional, default: []] - [ManifestRequest] - """ - - attribute_map = { - "provider_type": "provider_type", # noqa: E501 - "resource": "resource", # noqa: E501 - "display_name": "display_name", # noqa: E501 - "owner": "owner", # noqa: E501 - "credentials_type": "credentials_type", # noqa: E501 - "session_token": "session_token", # noqa: E501 - "account_name": "account_name", # noqa: E501 - "key": "key", # noqa: E501 - "secret_key": "secret_key", # noqa: E501 - "key_file": "key_file", # noqa: E501 - "specific_attributes": "specific_attributes", # noqa: E501 - "description": "description", # noqa: E501 - "manifests": "manifests", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PatchedCloudStorageWriteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - provider_type (ProviderTypeEnum): [optional] # noqa: E501 - resource (str): [optional] # noqa: E501 - display_name (str): [optional] # noqa: E501 - owner (BasicUserRequest): [optional] # noqa: E501 - credentials_type (CredentialsTypeEnum): [optional] # noqa: E501 - session_token (str): [optional] # noqa: E501 - account_name (str): [optional] # noqa: E501 - key (str): [optional] # noqa: E501 - secret_key (str): [optional] # noqa: E501 - key_file (file_type): [optional] # noqa: E501 - specific_attributes (str): [optional] # noqa: E501 - description (str): [optional] # noqa: E501 - manifests ([ManifestRequest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PatchedCloudStorageWriteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - provider_type (ProviderTypeEnum): [optional] # noqa: E501 - resource (str): [optional] # noqa: E501 - display_name (str): [optional] # noqa: E501 - owner (BasicUserRequest): [optional] # noqa: E501 - credentials_type (CredentialsTypeEnum): [optional] # noqa: E501 - session_token (str): [optional] # noqa: E501 - account_name (str): [optional] # noqa: E501 - key (str): [optional] # noqa: E501 - secret_key (str): [optional] # noqa: E501 - key_file (file_type): [optional] # noqa: E501 - specific_attributes (str): [optional] # noqa: E501 - description (str): [optional] # noqa: E501 - manifests ([ManifestRequest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/patched_comment_write_request.py b/cvat-sdk/cvat_sdk/model/patched_comment_write_request.py deleted file mode 100644 index 9cd75883..00000000 --- a/cvat-sdk/cvat_sdk/model/patched_comment_write_request.py +++ /dev/null @@ -1,317 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class PatchedCommentWriteRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - issue (int): [optional] # noqa: E501 - - message (str): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("message",): { - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "issue": (int,), # noqa: E501 - "message": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - issue: int # noqa: E501 - """ - [optional] - """ - - message: str # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "issue": "issue", # noqa: E501 - "message": "message", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PatchedCommentWriteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - issue (int): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PatchedCommentWriteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - issue (int): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/patched_invitation_write_request.py b/cvat-sdk/cvat_sdk/model/patched_invitation_write_request.py deleted file mode 100644 index 3189f712..00000000 --- a/cvat-sdk/cvat_sdk/model/patched_invitation_write_request.py +++ /dev/null @@ -1,325 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.role_enum import RoleEnum - - globals()["RoleEnum"] = RoleEnum - - -class PatchedInvitationWriteRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - role (RoleEnum): [optional] # noqa: E501 - - email (str): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("email",): { - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "role": (RoleEnum,), # noqa: E501 - "email": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - role: RoleEnum # noqa: E501 - """ - [optional] - """ - - email: str # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "role": "role", # noqa: E501 - "email": "email", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PatchedInvitationWriteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - role (RoleEnum): [optional] # noqa: E501 - email (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PatchedInvitationWriteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - role (RoleEnum): [optional] # noqa: E501 - email (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/patched_issue_write_request.py b/cvat-sdk/cvat_sdk/model/patched_issue_write_request.py deleted file mode 100644 index 01876243..00000000 --- a/cvat-sdk/cvat_sdk/model/patched_issue_write_request.py +++ /dev/null @@ -1,365 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class PatchedIssueWriteRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - frame (int): [optional] # noqa: E501 - - position ([float]): [optional] # noqa: E501 - - job (int): [optional] # noqa: E501 - - assignee (int, none_type): [optional] # noqa: E501 - - message (str): [optional] # noqa: E501 - - resolved (bool): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("message",): { - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "frame": (int,), # noqa: E501 - "position": ([float],), # noqa: E501 - "job": (int,), # noqa: E501 - "assignee": ( - int, - none_type, - ), # noqa: E501 - "message": (str,), # noqa: E501 - "resolved": (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - frame: int # noqa: E501 - """ - [optional] - """ - - position: typing.List[float] # noqa: E501 - """ - [optional] - [float] - """ - - job: int # noqa: E501 - """ - [optional] - """ - - assignee: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - message: str # noqa: E501 - """ - [optional] - """ - - resolved: bool # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "frame": "frame", # noqa: E501 - "position": "position", # noqa: E501 - "job": "job", # noqa: E501 - "assignee": "assignee", # noqa: E501 - "message": "message", # noqa: E501 - "resolved": "resolved", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PatchedIssueWriteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - frame (int): [optional] # noqa: E501 - position ([float]): [optional] # noqa: E501 - job (int): [optional] # noqa: E501 - assignee (int, none_type): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - resolved (bool): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PatchedIssueWriteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - frame (int): [optional] # noqa: E501 - position ([float]): [optional] # noqa: E501 - job (int): [optional] # noqa: E501 - assignee (int, none_type): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - resolved (bool): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/patched_job_write_request.py b/cvat-sdk/cvat_sdk/model/patched_job_write_request.py deleted file mode 100644 index 59e0353d..00000000 --- a/cvat-sdk/cvat_sdk/model/patched_job_write_request.py +++ /dev/null @@ -1,337 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.job_stage import JobStage - from cvat_sdk.model.operation_status import OperationStatus - - globals()["JobStage"] = JobStage - globals()["OperationStatus"] = OperationStatus - - -class PatchedJobWriteRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - assignee (int, none_type): [optional] # noqa: E501 - - stage (JobStage): [optional] # noqa: E501 - - state (OperationStatus): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "assignee": ( - int, - none_type, - ), # noqa: E501 - "stage": (JobStage,), # noqa: E501 - "state": (OperationStatus,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - assignee: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - stage: JobStage # noqa: E501 - """ - [optional] - """ - - state: OperationStatus # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "assignee": "assignee", # noqa: E501 - "stage": "stage", # noqa: E501 - "state": "state", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PatchedJobWriteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - assignee (int, none_type): [optional] # noqa: E501 - stage (JobStage): [optional] # noqa: E501 - state (OperationStatus): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PatchedJobWriteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - assignee (int, none_type): [optional] # noqa: E501 - stage (JobStage): [optional] # noqa: E501 - state (OperationStatus): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/patched_label_request.py b/cvat-sdk/cvat_sdk/model/patched_label_request.py deleted file mode 100644 index 49ffe8e6..00000000 --- a/cvat-sdk/cvat_sdk/model/patched_label_request.py +++ /dev/null @@ -1,361 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.attribute_request import AttributeRequest - - globals()["AttributeRequest"] = AttributeRequest - - -class PatchedLabelRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - id (int): [optional] # noqa: E501 - - name (str): [optional] # noqa: E501 - - color (str): [optional] # noqa: E501 - - attributes ([AttributeRequest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - - deleted (bool): Delete label if value is true from proper Task/Project object. [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("name",): { - "max_length": 64, - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "id": (int,), # noqa: E501 - "name": (str,), # noqa: E501 - "color": (str,), # noqa: E501 - "attributes": ([AttributeRequest],), # noqa: E501 - "deleted": (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - id: int # noqa: E501 - """ - [optional] - """ - - name: str # noqa: E501 - """ - [optional] - """ - - color: str # noqa: E501 - """ - [optional] - """ - - attributes: typing.List[AttributeRequest] # noqa: E501 - """ - [optional, default: []] - [AttributeRequest] - """ - - deleted: bool # noqa: E501 - """ - [optional] - Delete label if value is true from proper Task/Project object. - """ - - attribute_map = { - "id": "id", # noqa: E501 - "name": "name", # noqa: E501 - "color": "color", # noqa: E501 - "attributes": "attributes", # noqa: E501 - "deleted": "deleted", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PatchedLabelRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - color (str): [optional] # noqa: E501 - attributes ([AttributeRequest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - deleted (bool): Delete label if value is true from proper Task/Project object. [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PatchedLabelRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - color (str): [optional] # noqa: E501 - attributes ([AttributeRequest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - deleted (bool): Delete label if value is true from proper Task/Project object. [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/patched_membership_write_request.py b/cvat-sdk/cvat_sdk/model/patched_membership_write_request.py deleted file mode 100644 index edbd7bec..00000000 --- a/cvat-sdk/cvat_sdk/model/patched_membership_write_request.py +++ /dev/null @@ -1,310 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.role_enum import RoleEnum - - globals()["RoleEnum"] = RoleEnum - - -class PatchedMembershipWriteRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - role (RoleEnum): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "role": (RoleEnum,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - role: RoleEnum # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "role": "role", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PatchedMembershipWriteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - role (RoleEnum): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PatchedMembershipWriteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - role (RoleEnum): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/patched_organization_write_request.py b/cvat-sdk/cvat_sdk/model/patched_organization_write_request.py deleted file mode 100644 index 6dcb37d5..00000000 --- a/cvat-sdk/cvat_sdk/model/patched_organization_write_request.py +++ /dev/null @@ -1,349 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class PatchedOrganizationWriteRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - slug (str): [optional] # noqa: E501 - - name (str): [optional] # noqa: E501 - - description (str): [optional] # noqa: E501 - - contact ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("slug",): { - "max_length": 16, - "min_length": 1, - "regex": { - "pattern": r"^[-a-zA-Z0-9_]+$", # noqa: E501 - }, - }, - ("name",): { - "max_length": 64, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "slug": (str,), # noqa: E501 - "name": (str,), # noqa: E501 - "description": (str,), # noqa: E501 - "contact": ( - {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, - ), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - slug: str # noqa: E501 - """ - [optional] - """ - - name: str # noqa: E501 - """ - [optional] - """ - - description: str # noqa: E501 - """ - [optional] - """ - - contact: typing.Dict[str, typing.Union[typing.Any, none_type]] # noqa: E501 - """ - [optional] - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - """ - - attribute_map = { - "slug": "slug", # noqa: E501 - "name": "name", # noqa: E501 - "description": "description", # noqa: E501 - "contact": "contact", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PatchedOrganizationWriteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - slug (str): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - description (str): [optional] # noqa: E501 - contact ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PatchedOrganizationWriteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - slug (str): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - description (str): [optional] # noqa: E501 - contact ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/patched_project_write_request.py b/cvat-sdk/cvat_sdk/model/patched_project_write_request.py deleted file mode 100644 index 0281d55d..00000000 --- a/cvat-sdk/cvat_sdk/model/patched_project_write_request.py +++ /dev/null @@ -1,407 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.patched_label_request import PatchedLabelRequest - from cvat_sdk.model.patched_project_write_request_target_storage import ( - PatchedProjectWriteRequestTargetStorage, - ) - - globals()["PatchedLabelRequest"] = PatchedLabelRequest - globals()["PatchedProjectWriteRequestTargetStorage"] = PatchedProjectWriteRequestTargetStorage - - -class PatchedProjectWriteRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - name (str): [optional] # noqa: E501 - - labels ([PatchedLabelRequest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - - owner_id (int, none_type): [optional] # noqa: E501 - - assignee_id (int, none_type): [optional] # noqa: E501 - - bug_tracker (str): [optional] # noqa: E501 - - target_storage (PatchedProjectWriteRequestTargetStorage): [optional] # noqa: E501 - - source_storage (PatchedProjectWriteRequestTargetStorage): [optional] # noqa: E501 - - task_subsets ([str]): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("name",): { - "max_length": 256, - "min_length": 1, - }, - ("bug_tracker",): { - "max_length": 2000, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "name": (str,), # noqa: E501 - "labels": ([PatchedLabelRequest],), # noqa: E501 - "owner_id": ( - int, - none_type, - ), # noqa: E501 - "assignee_id": ( - int, - none_type, - ), # noqa: E501 - "bug_tracker": (str,), # noqa: E501 - "target_storage": (PatchedProjectWriteRequestTargetStorage,), # noqa: E501 - "source_storage": (PatchedProjectWriteRequestTargetStorage,), # noqa: E501 - "task_subsets": ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - name: str # noqa: E501 - """ - [optional] - """ - - labels: typing.List[PatchedLabelRequest] # noqa: E501 - """ - [optional, default: []] - [PatchedLabelRequest] - """ - - owner_id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - assignee_id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - bug_tracker: str # noqa: E501 - """ - [optional] - """ - - target_storage: PatchedProjectWriteRequestTargetStorage # noqa: E501 - """ - [optional] - """ - - source_storage: PatchedProjectWriteRequestTargetStorage # noqa: E501 - """ - [optional] - """ - - task_subsets: typing.List[str] # noqa: E501 - """ - [optional] - [str] - """ - - attribute_map = { - "name": "name", # noqa: E501 - "labels": "labels", # noqa: E501 - "owner_id": "owner_id", # noqa: E501 - "assignee_id": "assignee_id", # noqa: E501 - "bug_tracker": "bug_tracker", # noqa: E501 - "target_storage": "target_storage", # noqa: E501 - "source_storage": "source_storage", # noqa: E501 - "task_subsets": "task_subsets", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PatchedProjectWriteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - labels ([PatchedLabelRequest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - owner_id (int, none_type): [optional] # noqa: E501 - assignee_id (int, none_type): [optional] # noqa: E501 - bug_tracker (str): [optional] # noqa: E501 - target_storage (PatchedProjectWriteRequestTargetStorage): [optional] # noqa: E501 - source_storage (PatchedProjectWriteRequestTargetStorage): [optional] # noqa: E501 - task_subsets ([str]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PatchedProjectWriteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - labels ([PatchedLabelRequest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - owner_id (int, none_type): [optional] # noqa: E501 - assignee_id (int, none_type): [optional] # noqa: E501 - bug_tracker (str): [optional] # noqa: E501 - target_storage (PatchedProjectWriteRequestTargetStorage): [optional] # noqa: E501 - source_storage (PatchedProjectWriteRequestTargetStorage): [optional] # noqa: E501 - task_subsets ([str]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/patched_project_write_request_target_storage.py b/cvat-sdk/cvat_sdk/model/patched_project_write_request_target_storage.py deleted file mode 100644 index 7712baf7..00000000 --- a/cvat-sdk/cvat_sdk/model/patched_project_write_request_target_storage.py +++ /dev/null @@ -1,371 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.location_enum import LocationEnum - from cvat_sdk.model.storage_request import StorageRequest - - globals()["LocationEnum"] = LocationEnum - globals()["StorageRequest"] = StorageRequest - - -class PatchedProjectWriteRequestTargetStorage(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "location": (LocationEnum,), # noqa: E501 - "cloud_storage_id": ( - int, - none_type, - ), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - location: LocationEnum # noqa: E501 - """ - [optional] - """ - - cloud_storage_id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "location": "location", # noqa: E501 - "cloud_storage_id": "cloud_storage_id", # noqa: E501 - } - - read_only_vars = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data( - cls, *args, **kwargs - ) -> PatchedProjectWriteRequestTargetStorage: # noqa: E501 - """PatchedProjectWriteRequestTargetStorage - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - location (LocationEnum): [optional] # noqa: E501 - cloud_storage_id (int, none_type): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - "_check_type": _check_type, - "_path_to_item": _path_to_item, - "_spec_property_naming": _spec_property_naming, - "_configuration": _configuration, - "_visited_composed_classes": self._visited_composed_classes, - } - required_args = {} - kwargs.update(required_args) - composed_info = validate_get_composed_info(constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if ( - var_name in discarded_args - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self._additional_properties_model_instances - ): - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - "_composed_instances", - "_var_name_to_model_instances", - "_additional_properties_model_instances", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PatchedProjectWriteRequestTargetStorage - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - location (LocationEnum): [optional] # noqa: E501 - cloud_storage_id (int, none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - "_check_type": _check_type, - "_path_to_item": _path_to_item, - "_spec_property_naming": _spec_property_naming, - "_configuration": _configuration, - "_visited_composed_classes": self._visited_composed_classes, - } - required_args = {} - kwargs.update(required_args) - composed_info = validate_get_composed_info(constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if ( - var_name in discarded_args - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self._additional_properties_model_instances - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - "anyOf": [], - "allOf": [ - StorageRequest, - ], - "oneOf": [], - } diff --git a/cvat-sdk/cvat_sdk/model/patched_task_write_request.py b/cvat-sdk/cvat_sdk/model/patched_task_write_request.py deleted file mode 100644 index 36c39e26..00000000 --- a/cvat-sdk/cvat_sdk/model/patched_task_write_request.py +++ /dev/null @@ -1,448 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.patched_label_request import PatchedLabelRequest - from cvat_sdk.model.patched_task_write_request_target_storage import ( - PatchedTaskWriteRequestTargetStorage, - ) - - globals()["PatchedLabelRequest"] = PatchedLabelRequest - globals()["PatchedTaskWriteRequestTargetStorage"] = PatchedTaskWriteRequestTargetStorage - - -class PatchedTaskWriteRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - name (str): [optional] # noqa: E501 - - project_id (int, none_type): [optional] # noqa: E501 - - owner_id (int, none_type): [optional] # noqa: E501 - - assignee_id (int, none_type): [optional] # noqa: E501 - - bug_tracker (str): [optional] # noqa: E501 - - overlap (int, none_type): [optional] # noqa: E501 - - segment_size (int): [optional] # noqa: E501 - - labels ([PatchedLabelRequest]): [optional] # noqa: E501 - - subset (str): [optional] # noqa: E501 - - target_storage (PatchedTaskWriteRequestTargetStorage): [optional] # noqa: E501 - - source_storage (PatchedTaskWriteRequestTargetStorage): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("name",): { - "max_length": 256, - "min_length": 1, - }, - ("bug_tracker",): { - "max_length": 2000, - }, - ("subset",): { - "max_length": 64, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "name": (str,), # noqa: E501 - "project_id": ( - int, - none_type, - ), # noqa: E501 - "owner_id": ( - int, - none_type, - ), # noqa: E501 - "assignee_id": ( - int, - none_type, - ), # noqa: E501 - "bug_tracker": (str,), # noqa: E501 - "overlap": ( - int, - none_type, - ), # noqa: E501 - "segment_size": (int,), # noqa: E501 - "labels": ([PatchedLabelRequest],), # noqa: E501 - "subset": (str,), # noqa: E501 - "target_storage": (PatchedTaskWriteRequestTargetStorage,), # noqa: E501 - "source_storage": (PatchedTaskWriteRequestTargetStorage,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - name: str # noqa: E501 - """ - [optional] - """ - - project_id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - owner_id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - assignee_id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - bug_tracker: str # noqa: E501 - """ - [optional] - """ - - overlap: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - segment_size: int # noqa: E501 - """ - [optional] - """ - - labels: typing.List[PatchedLabelRequest] # noqa: E501 - """ - [optional] - [PatchedLabelRequest] - """ - - subset: str # noqa: E501 - """ - [optional] - """ - - target_storage: PatchedTaskWriteRequestTargetStorage # noqa: E501 - """ - [optional] - """ - - source_storage: PatchedTaskWriteRequestTargetStorage # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "name": "name", # noqa: E501 - "project_id": "project_id", # noqa: E501 - "owner_id": "owner_id", # noqa: E501 - "assignee_id": "assignee_id", # noqa: E501 - "bug_tracker": "bug_tracker", # noqa: E501 - "overlap": "overlap", # noqa: E501 - "segment_size": "segment_size", # noqa: E501 - "labels": "labels", # noqa: E501 - "subset": "subset", # noqa: E501 - "target_storage": "target_storage", # noqa: E501 - "source_storage": "source_storage", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PatchedTaskWriteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - project_id (int, none_type): [optional] # noqa: E501 - owner_id (int, none_type): [optional] # noqa: E501 - assignee_id (int, none_type): [optional] # noqa: E501 - bug_tracker (str): [optional] # noqa: E501 - overlap (int, none_type): [optional] # noqa: E501 - segment_size (int): [optional] # noqa: E501 - labels ([PatchedLabelRequest]): [optional] # noqa: E501 - subset (str): [optional] # noqa: E501 - target_storage (PatchedTaskWriteRequestTargetStorage): [optional] # noqa: E501 - source_storage (PatchedTaskWriteRequestTargetStorage): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PatchedTaskWriteRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): [optional] # noqa: E501 - project_id (int, none_type): [optional] # noqa: E501 - owner_id (int, none_type): [optional] # noqa: E501 - assignee_id (int, none_type): [optional] # noqa: E501 - bug_tracker (str): [optional] # noqa: E501 - overlap (int, none_type): [optional] # noqa: E501 - segment_size (int): [optional] # noqa: E501 - labels ([PatchedLabelRequest]): [optional] # noqa: E501 - subset (str): [optional] # noqa: E501 - target_storage (PatchedTaskWriteRequestTargetStorage): [optional] # noqa: E501 - source_storage (PatchedTaskWriteRequestTargetStorage): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/patched_task_write_request_target_storage.py b/cvat-sdk/cvat_sdk/model/patched_task_write_request_target_storage.py deleted file mode 100644 index f42755b3..00000000 --- a/cvat-sdk/cvat_sdk/model/patched_task_write_request_target_storage.py +++ /dev/null @@ -1,371 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.location_enum import LocationEnum - from cvat_sdk.model.storage_request import StorageRequest - - globals()["LocationEnum"] = LocationEnum - globals()["StorageRequest"] = StorageRequest - - -class PatchedTaskWriteRequestTargetStorage(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "location": (LocationEnum,), # noqa: E501 - "cloud_storage_id": ( - int, - none_type, - ), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - location: LocationEnum # noqa: E501 - """ - [optional] - """ - - cloud_storage_id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "location": "location", # noqa: E501 - "cloud_storage_id": "cloud_storage_id", # noqa: E501 - } - - read_only_vars = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data( - cls, *args, **kwargs - ) -> PatchedTaskWriteRequestTargetStorage: # noqa: E501 - """PatchedTaskWriteRequestTargetStorage - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - location (LocationEnum): [optional] # noqa: E501 - cloud_storage_id (int, none_type): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - "_check_type": _check_type, - "_path_to_item": _path_to_item, - "_spec_property_naming": _spec_property_naming, - "_configuration": _configuration, - "_visited_composed_classes": self._visited_composed_classes, - } - required_args = {} - kwargs.update(required_args) - composed_info = validate_get_composed_info(constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if ( - var_name in discarded_args - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self._additional_properties_model_instances - ): - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - "_composed_instances", - "_var_name_to_model_instances", - "_additional_properties_model_instances", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PatchedTaskWriteRequestTargetStorage - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - location (LocationEnum): [optional] # noqa: E501 - cloud_storage_id (int, none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - "_check_type": _check_type, - "_path_to_item": _path_to_item, - "_spec_property_naming": _spec_property_naming, - "_configuration": _configuration, - "_visited_composed_classes": self._visited_composed_classes, - } - required_args = {} - kwargs.update(required_args) - composed_info = validate_get_composed_info(constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if ( - var_name in discarded_args - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self._additional_properties_model_instances - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - "anyOf": [], - "allOf": [ - StorageRequest, - ], - "oneOf": [], - } diff --git a/cvat-sdk/cvat_sdk/model/patched_user_request.py b/cvat-sdk/cvat_sdk/model/patched_user_request.py deleted file mode 100644 index 1e923554..00000000 --- a/cvat-sdk/cvat_sdk/model/patched_user_request.py +++ /dev/null @@ -1,401 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class PatchedUserRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - username (str): Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.. [optional] # noqa: E501 - - first_name (str): [optional] # noqa: E501 - - last_name (str): [optional] # noqa: E501 - - email (str): [optional] # noqa: E501 - - groups ([str]): [optional] # noqa: E501 - - is_staff (bool): Designates whether the user can log into this admin site.. [optional] # noqa: E501 - - is_superuser (bool): Designates that this user has all permissions without explicitly assigning them.. [optional] # noqa: E501 - - is_active (bool): Designates whether this user should be treated as active. Unselect this instead of deleting accounts.. [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("username",): { - "max_length": 150, - "min_length": 1, - "regex": { - "pattern": r"^[\w.@+-]+$", # noqa: E501 - }, - }, - ("first_name",): { - "max_length": 150, - }, - ("last_name",): { - "max_length": 150, - }, - ("email",): { - "max_length": 254, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "username": (str,), # noqa: E501 - "first_name": (str,), # noqa: E501 - "last_name": (str,), # noqa: E501 - "email": (str,), # noqa: E501 - "groups": ([str],), # noqa: E501 - "is_staff": (bool,), # noqa: E501 - "is_superuser": (bool,), # noqa: E501 - "is_active": (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - username: str # noqa: E501 - """ - [optional] - Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.. - """ - - first_name: str # noqa: E501 - """ - [optional] - """ - - last_name: str # noqa: E501 - """ - [optional] - """ - - email: str # noqa: E501 - """ - [optional] - """ - - groups: typing.List[str] # noqa: E501 - """ - [optional] - [str] - """ - - is_staff: bool # noqa: E501 - """ - [optional] - Designates whether the user can log into this admin site.. - """ - - is_superuser: bool # noqa: E501 - """ - [optional] - Designates that this user has all permissions without explicitly assigning them.. - """ - - is_active: bool # noqa: E501 - """ - [optional] - Designates whether this user should be treated as active. Unselect this instead of deleting accounts.. - """ - - attribute_map = { - "username": "username", # noqa: E501 - "first_name": "first_name", # noqa: E501 - "last_name": "last_name", # noqa: E501 - "email": "email", # noqa: E501 - "groups": "groups", # noqa: E501 - "is_staff": "is_staff", # noqa: E501 - "is_superuser": "is_superuser", # noqa: E501 - "is_active": "is_active", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """PatchedUserRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - username (str): Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.. [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - email (str): [optional] # noqa: E501 - groups ([str]): [optional] # noqa: E501 - is_staff (bool): Designates whether the user can log into this admin site.. [optional] # noqa: E501 - is_superuser (bool): Designates that this user has all permissions without explicitly assigning them.. [optional] # noqa: E501 - is_active (bool): Designates whether this user should be treated as active. Unselect this instead of deleting accounts.. [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """PatchedUserRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - username (str): Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.. [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - email (str): [optional] # noqa: E501 - groups ([str]): [optional] # noqa: E501 - is_staff (bool): Designates whether the user can log into this admin site.. [optional] # noqa: E501 - is_superuser (bool): Designates that this user has all permissions without explicitly assigning them.. [optional] # noqa: E501 - is_active (bool): Designates whether this user should be treated as active. Unselect this instead of deleting accounts.. [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/plugins.py b/cvat-sdk/cvat_sdk/model/plugins.py deleted file mode 100644 index 3315c1e0..00000000 --- a/cvat-sdk/cvat_sdk/model/plugins.py +++ /dev/null @@ -1,345 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class Plugins(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - git_integration (bool): - - analytics (bool): - - models (bool): - - predict (bool): - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "git_integration": (bool,), # noqa: E501 - "analytics": (bool,), # noqa: E501 - "models": (bool,), # noqa: E501 - "predict": (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - git_integration: bool # noqa: E501 - """ - """ - - analytics: bool # noqa: E501 - """ - """ - - models: bool # noqa: E501 - """ - """ - - predict: bool # noqa: E501 - """ - """ - - attribute_map = { - "git_integration": "GIT_INTEGRATION", # noqa: E501 - "analytics": "ANALYTICS", # noqa: E501 - "models": "MODELS", # noqa: E501 - "predict": "PREDICT", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data( - cls, git_integration, analytics, models, predict, *args, **kwargs - ): # noqa: E501 - """Plugins - a model defined in OpenAPI - - Args: - git_integration (bool): - analytics (bool): - models (bool): - predict (bool): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.git_integration = git_integration - self.analytics = analytics - self.models = models - self.predict = predict - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, git_integration, analytics, models, predict, *args, **kwargs): # noqa: E501 - """Plugins - a model defined in OpenAPI - - Args: - git_integration (bool): - analytics (bool): - models (bool): - predict (bool): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.git_integration = git_integration - self.analytics = analytics - self.models = models - self.predict = predict - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/polymorphic_project.py b/cvat-sdk/cvat_sdk/model/polymorphic_project.py deleted file mode 100644 index 8b5965f9..00000000 --- a/cvat-sdk/cvat_sdk/model/polymorphic_project.py +++ /dev/null @@ -1,551 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.job_status import JobStatus - from cvat_sdk.model.label import Label - from cvat_sdk.model.project_read import ProjectRead - from cvat_sdk.model.project_read_assignee import ProjectReadAssignee - from cvat_sdk.model.project_read_owner import ProjectReadOwner - from cvat_sdk.model.project_read_target_storage import ProjectReadTargetStorage - from cvat_sdk.model.project_search import ProjectSearch - - globals()["JobStatus"] = JobStatus - globals()["Label"] = Label - globals()["ProjectRead"] = ProjectRead - globals()["ProjectReadAssignee"] = ProjectReadAssignee - globals()["ProjectReadOwner"] = ProjectReadOwner - globals()["ProjectReadTargetStorage"] = ProjectReadTargetStorage - globals()["ProjectSearch"] = ProjectSearch - - -class PolymorphicProject(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = { - ("bug_tracker",): { - "max_length": 2000, - }, - ("dimension",): { - "max_length": 16, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "name": (str,), # noqa: E501 - "url": (str,), # noqa: E501 - "id": (int,), # noqa: E501 - "labels": ([Label],), # noqa: E501 - "tasks": ([int],), # noqa: E501 - "owner": (ProjectReadOwner,), # noqa: E501 - "assignee": (ProjectReadAssignee,), # noqa: E501 - "bug_tracker": (str,), # noqa: E501 - "task_subsets": ([str],), # noqa: E501 - "created_date": (datetime,), # noqa: E501 - "updated_date": (datetime,), # noqa: E501 - "status": ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ), # noqa: E501 - "dimension": ( - str, - none_type, - ), # noqa: E501 - "organization": ( - int, - none_type, - ), # noqa: E501 - "target_storage": (ProjectReadTargetStorage,), # noqa: E501 - "source_storage": (ProjectReadTargetStorage,), # noqa: E501 - } - - @cached_property - def discriminator(): - lazy_import() - val = { - "None": ProjectSearch, - "ProjectRead": ProjectRead, - "ProjectSearch": ProjectSearch, - } - if not val: - return None - return {"name": val} - - # member type declarations - url: str # noqa: E501 - """ - [optional] - """ - - id: int # noqa: E501 - """ - [optional] - """ - - name: str # noqa: E501 - """ - """ - - labels: typing.List[Label] # noqa: E501 - """ - [optional, default: []] - [Label] - """ - - tasks: typing.List[int] # noqa: E501 - """ - [optional] - [int] - """ - - owner: ProjectReadOwner # noqa: E501 - """ - [optional] - """ - - assignee: ProjectReadAssignee # noqa: E501 - """ - [optional] - """ - - bug_tracker: str # noqa: E501 - """ - [optional] - """ - - task_subsets: typing.List[str] # noqa: E501 - """ - [optional] - [str] - """ - - created_date: datetime # noqa: E501 - """ - [optional] - """ - - updated_date: datetime # noqa: E501 - """ - [optional] - """ - - status: typing.Union[typing.Any, none_type] # noqa: E501 - """ - [optional] - """ - - dimension: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - organization: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - target_storage: ProjectReadTargetStorage # noqa: E501 - """ - [optional] - """ - - source_storage: ProjectReadTargetStorage # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "name": "name", # noqa: E501 - "url": "url", # noqa: E501 - "id": "id", # noqa: E501 - "labels": "labels", # noqa: E501 - "tasks": "tasks", # noqa: E501 - "owner": "owner", # noqa: E501 - "assignee": "assignee", # noqa: E501 - "bug_tracker": "bug_tracker", # noqa: E501 - "task_subsets": "task_subsets", # noqa: E501 - "created_date": "created_date", # noqa: E501 - "updated_date": "updated_date", # noqa: E501 - "status": "status", # noqa: E501 - "dimension": "dimension", # noqa: E501 - "organization": "organization", # noqa: E501 - "target_storage": "target_storage", # noqa: E501 - "source_storage": "source_storage", # noqa: E501 - } - - read_only_vars = { - "name", # noqa: E501 - "url", # noqa: E501 - "id", # noqa: E501 - "labels", # noqa: E501 - "tasks", # noqa: E501 - "task_subsets", # noqa: E501 - "created_date", # noqa: E501 - "updated_date", # noqa: E501 - "status", # noqa: E501 - "dimension", # noqa: E501 - "organization", # noqa: E501 - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, *args, **kwargs) -> PolymorphicProject: # noqa: E501 - """PolymorphicProject - a model defined in OpenAPI - - Keyword Args: - name (str): - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - labels ([Label]): [optional] if omitted the server will use the default value of [] # noqa: E501 - tasks ([int]): [optional] # noqa: E501 - owner (ProjectReadOwner): [optional] # noqa: E501 - assignee (ProjectReadAssignee): [optional] # noqa: E501 - bug_tracker (str): [optional] # noqa: E501 - task_subsets ([str]): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - dimension (str, none_type): [optional] # noqa: E501 - organization (int, none_type): [optional] # noqa: E501 - target_storage (ProjectReadTargetStorage): [optional] # noqa: E501 - source_storage (ProjectReadTargetStorage): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - "_check_type": _check_type, - "_path_to_item": _path_to_item, - "_spec_property_naming": _spec_property_naming, - "_configuration": _configuration, - "_visited_composed_classes": self._visited_composed_classes, - } - required_args = { - "name": name, - } - kwargs.update(required_args) - composed_info = validate_get_composed_info(constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if ( - var_name in discarded_args - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self._additional_properties_model_instances - ): - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - "_composed_instances", - "_var_name_to_model_instances", - "_additional_properties_model_instances", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, name, *args, **kwargs): # noqa: E501 - """PolymorphicProject - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - labels ([Label]): [optional] if omitted the server will use the default value of [] # noqa: E501 - tasks ([int]): [optional] # noqa: E501 - owner (ProjectReadOwner): [optional] # noqa: E501 - assignee (ProjectReadAssignee): [optional] # noqa: E501 - bug_tracker (str): [optional] # noqa: E501 - task_subsets ([str]): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - dimension (str, none_type): [optional] # noqa: E501 - organization (int, none_type): [optional] # noqa: E501 - target_storage (ProjectReadTargetStorage): [optional] # noqa: E501 - source_storage (ProjectReadTargetStorage): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - "_check_type": _check_type, - "_path_to_item": _path_to_item, - "_spec_property_naming": _spec_property_naming, - "_configuration": _configuration, - "_visited_composed_classes": self._visited_composed_classes, - } - required_args = { - "name": name, - } - kwargs.update(required_args) - composed_info = validate_get_composed_info(constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if ( - var_name in discarded_args - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self._additional_properties_model_instances - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - "anyOf": [], - "allOf": [], - "oneOf": [ - ProjectRead, - ProjectSearch, - ], - } diff --git a/cvat-sdk/cvat_sdk/model/project_file_request.py b/cvat-sdk/cvat_sdk/model/project_file_request.py deleted file mode 100644 index d3c4e22a..00000000 --- a/cvat-sdk/cvat_sdk/model/project_file_request.py +++ /dev/null @@ -1,307 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class ProjectFileRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - project_file (file_type): - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "project_file": (file_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - project_file: file_type # noqa: E501 - """ - """ - - attribute_map = { - "project_file": "project_file", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, project_file, *args, **kwargs): # noqa: E501 - """ProjectFileRequest - a model defined in OpenAPI - - Args: - project_file (file_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.project_file = project_file - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, project_file, *args, **kwargs): # noqa: E501 - """ProjectFileRequest - a model defined in OpenAPI - - Args: - project_file (file_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.project_file = project_file - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/project_read.py b/cvat-sdk/cvat_sdk/model/project_read.py deleted file mode 100644 index 98e20884..00000000 --- a/cvat-sdk/cvat_sdk/model/project_read.py +++ /dev/null @@ -1,528 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.job_status import JobStatus - from cvat_sdk.model.label import Label - from cvat_sdk.model.project_read_assignee import ProjectReadAssignee - from cvat_sdk.model.project_read_owner import ProjectReadOwner - from cvat_sdk.model.project_read_target_storage import ProjectReadTargetStorage - - globals()["JobStatus"] = JobStatus - globals()["Label"] = Label - globals()["ProjectReadAssignee"] = ProjectReadAssignee - globals()["ProjectReadOwner"] = ProjectReadOwner - globals()["ProjectReadTargetStorage"] = ProjectReadTargetStorage - - -class ProjectRead(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - name (str): - - url (str): [optional] # noqa: E501 - - id (int): [optional] # noqa: E501 - - labels ([Label]): [optional] if omitted the server will use the default value of [] # noqa: E501 - - tasks ([int]): [optional] # noqa: E501 - - owner (ProjectReadOwner): [optional] # noqa: E501 - - assignee (ProjectReadAssignee): [optional] # noqa: E501 - - bug_tracker (str): [optional] # noqa: E501 - - task_subsets ([str]): [optional] # noqa: E501 - - created_date (datetime): [optional] # noqa: E501 - - updated_date (datetime): [optional] # noqa: E501 - - status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - - dimension (str, none_type): [optional] # noqa: E501 - - organization (int, none_type): [optional] # noqa: E501 - - target_storage (ProjectReadTargetStorage): [optional] # noqa: E501 - - source_storage (ProjectReadTargetStorage): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("name",): { - "max_length": 256, - }, - ("bug_tracker",): { - "max_length": 2000, - }, - ("dimension",): { - "max_length": 16, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "name": (str,), # noqa: E501 - "url": (str,), # noqa: E501 - "id": (int,), # noqa: E501 - "labels": ([Label],), # noqa: E501 - "tasks": ([int],), # noqa: E501 - "owner": (ProjectReadOwner,), # noqa: E501 - "assignee": (ProjectReadAssignee,), # noqa: E501 - "bug_tracker": (str,), # noqa: E501 - "task_subsets": ([str],), # noqa: E501 - "created_date": (datetime,), # noqa: E501 - "updated_date": (datetime,), # noqa: E501 - "status": ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ), # noqa: E501 - "dimension": ( - str, - none_type, - ), # noqa: E501 - "organization": ( - int, - none_type, - ), # noqa: E501 - "target_storage": (ProjectReadTargetStorage,), # noqa: E501 - "source_storage": (ProjectReadTargetStorage,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - url: str # noqa: E501 - """ - [optional] - """ - - id: int # noqa: E501 - """ - [optional] - """ - - name: str # noqa: E501 - """ - """ - - labels: typing.List[Label] # noqa: E501 - """ - [optional, default: []] - [Label] - """ - - tasks: typing.List[int] # noqa: E501 - """ - [optional] - [int] - """ - - owner: ProjectReadOwner # noqa: E501 - """ - [optional] - """ - - assignee: ProjectReadAssignee # noqa: E501 - """ - [optional] - """ - - bug_tracker: str # noqa: E501 - """ - [optional] - """ - - task_subsets: typing.List[str] # noqa: E501 - """ - [optional] - [str] - """ - - created_date: datetime # noqa: E501 - """ - [optional] - """ - - updated_date: datetime # noqa: E501 - """ - [optional] - """ - - status: typing.Union[typing.Any, none_type] # noqa: E501 - """ - [optional] - """ - - dimension: typing.Union[str, none_type] # noqa: E501 - """ - [optional] - """ - - organization: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - target_storage: ProjectReadTargetStorage # noqa: E501 - """ - [optional] - """ - - source_storage: ProjectReadTargetStorage # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "name": "name", # noqa: E501 - "url": "url", # noqa: E501 - "id": "id", # noqa: E501 - "labels": "labels", # noqa: E501 - "tasks": "tasks", # noqa: E501 - "owner": "owner", # noqa: E501 - "assignee": "assignee", # noqa: E501 - "bug_tracker": "bug_tracker", # noqa: E501 - "task_subsets": "task_subsets", # noqa: E501 - "created_date": "created_date", # noqa: E501 - "updated_date": "updated_date", # noqa: E501 - "status": "status", # noqa: E501 - "dimension": "dimension", # noqa: E501 - "organization": "organization", # noqa: E501 - "target_storage": "target_storage", # noqa: E501 - "source_storage": "source_storage", # noqa: E501 - } - - read_only_vars = { - "url", # noqa: E501 - "id", # noqa: E501 - "labels", # noqa: E501 - "tasks", # noqa: E501 - "task_subsets", # noqa: E501 - "created_date", # noqa: E501 - "updated_date", # noqa: E501 - "status", # noqa: E501 - "dimension", # noqa: E501 - "organization", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 - """ProjectRead - a model defined in OpenAPI - - Args: - name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - labels ([Label]): [optional] if omitted the server will use the default value of [] # noqa: E501 - tasks ([int]): [optional] # noqa: E501 - owner (ProjectReadOwner): [optional] # noqa: E501 - assignee (ProjectReadAssignee): [optional] # noqa: E501 - bug_tracker (str): [optional] # noqa: E501 - task_subsets ([str]): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - dimension (str, none_type): [optional] # noqa: E501 - organization (int, none_type): [optional] # noqa: E501 - target_storage (ProjectReadTargetStorage): [optional] # noqa: E501 - source_storage (ProjectReadTargetStorage): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, name, *args, **kwargs): # noqa: E501 - """ProjectRead - a model defined in OpenAPI - - Args: - name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - labels ([Label]): [optional] if omitted the server will use the default value of [] # noqa: E501 - tasks ([int]): [optional] # noqa: E501 - owner (ProjectReadOwner): [optional] # noqa: E501 - assignee (ProjectReadAssignee): [optional] # noqa: E501 - bug_tracker (str): [optional] # noqa: E501 - task_subsets ([str]): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - dimension (str, none_type): [optional] # noqa: E501 - organization (int, none_type): [optional] # noqa: E501 - target_storage (ProjectReadTargetStorage): [optional] # noqa: E501 - source_storage (ProjectReadTargetStorage): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/project_read_assignee.py b/cvat-sdk/cvat_sdk/model/project_read_assignee.py deleted file mode 100644 index f86863f4..00000000 --- a/cvat-sdk/cvat_sdk/model/project_read_assignee.py +++ /dev/null @@ -1,411 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.basic_user import BasicUser - - globals()["BasicUser"] = BasicUser - - -class ProjectReadAssignee(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = { - ("username",): { - "max_length": 150, - "regex": { - "pattern": r"^[\w.@+-]+$", # noqa: E501 - }, - }, - ("first_name",): { - "max_length": 150, - }, - ("last_name",): { - "max_length": 150, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "username": (str,), # noqa: E501 - "url": (str,), # noqa: E501 - "id": (int,), # noqa: E501 - "first_name": (str,), # noqa: E501 - "last_name": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - url: str # noqa: E501 - """ - [optional] - """ - - id: int # noqa: E501 - """ - [optional] - """ - - username: str # noqa: E501 - """ - Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.. - """ - - first_name: str # noqa: E501 - """ - [optional] - """ - - last_name: str # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "username": "username", # noqa: E501 - "url": "url", # noqa: E501 - "id": "id", # noqa: E501 - "first_name": "first_name", # noqa: E501 - "last_name": "last_name", # noqa: E501 - } - - read_only_vars = { - "url", # noqa: E501 - "id", # noqa: E501 - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, username, *args, **kwargs) -> ProjectReadAssignee: # noqa: E501 - """ProjectReadAssignee - a model defined in OpenAPI - - Keyword Args: - username (str): Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - "_check_type": _check_type, - "_path_to_item": _path_to_item, - "_spec_property_naming": _spec_property_naming, - "_configuration": _configuration, - "_visited_composed_classes": self._visited_composed_classes, - } - required_args = { - "username": username, - } - kwargs.update(required_args) - composed_info = validate_get_composed_info(constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if ( - var_name in discarded_args - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self._additional_properties_model_instances - ): - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - "_composed_instances", - "_var_name_to_model_instances", - "_additional_properties_model_instances", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, username, *args, **kwargs): # noqa: E501 - """ProjectReadAssignee - a model defined in OpenAPI - - Keyword Args: - username (str): Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - "_check_type": _check_type, - "_path_to_item": _path_to_item, - "_spec_property_naming": _spec_property_naming, - "_configuration": _configuration, - "_visited_composed_classes": self._visited_composed_classes, - } - required_args = { - "username": username, - } - kwargs.update(required_args) - composed_info = validate_get_composed_info(constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if ( - var_name in discarded_args - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self._additional_properties_model_instances - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - "anyOf": [], - "allOf": [ - BasicUser, - ], - "oneOf": [], - } diff --git a/cvat-sdk/cvat_sdk/model/project_read_owner.py b/cvat-sdk/cvat_sdk/model/project_read_owner.py deleted file mode 100644 index b771b88b..00000000 --- a/cvat-sdk/cvat_sdk/model/project_read_owner.py +++ /dev/null @@ -1,411 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.basic_user import BasicUser - - globals()["BasicUser"] = BasicUser - - -class ProjectReadOwner(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = { - ("username",): { - "max_length": 150, - "regex": { - "pattern": r"^[\w.@+-]+$", # noqa: E501 - }, - }, - ("first_name",): { - "max_length": 150, - }, - ("last_name",): { - "max_length": 150, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "username": (str,), # noqa: E501 - "url": (str,), # noqa: E501 - "id": (int,), # noqa: E501 - "first_name": (str,), # noqa: E501 - "last_name": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - url: str # noqa: E501 - """ - [optional] - """ - - id: int # noqa: E501 - """ - [optional] - """ - - username: str # noqa: E501 - """ - Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.. - """ - - first_name: str # noqa: E501 - """ - [optional] - """ - - last_name: str # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "username": "username", # noqa: E501 - "url": "url", # noqa: E501 - "id": "id", # noqa: E501 - "first_name": "first_name", # noqa: E501 - "last_name": "last_name", # noqa: E501 - } - - read_only_vars = { - "url", # noqa: E501 - "id", # noqa: E501 - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, username, *args, **kwargs) -> ProjectReadOwner: # noqa: E501 - """ProjectReadOwner - a model defined in OpenAPI - - Keyword Args: - username (str): Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - "_check_type": _check_type, - "_path_to_item": _path_to_item, - "_spec_property_naming": _spec_property_naming, - "_configuration": _configuration, - "_visited_composed_classes": self._visited_composed_classes, - } - required_args = { - "username": username, - } - kwargs.update(required_args) - composed_info = validate_get_composed_info(constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if ( - var_name in discarded_args - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self._additional_properties_model_instances - ): - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - "_composed_instances", - "_var_name_to_model_instances", - "_additional_properties_model_instances", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, username, *args, **kwargs): # noqa: E501 - """ProjectReadOwner - a model defined in OpenAPI - - Keyword Args: - username (str): Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - "_check_type": _check_type, - "_path_to_item": _path_to_item, - "_spec_property_naming": _spec_property_naming, - "_configuration": _configuration, - "_visited_composed_classes": self._visited_composed_classes, - } - required_args = { - "username": username, - } - kwargs.update(required_args) - composed_info = validate_get_composed_info(constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if ( - var_name in discarded_args - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self._additional_properties_model_instances - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - "anyOf": [], - "allOf": [ - BasicUser, - ], - "oneOf": [], - } diff --git a/cvat-sdk/cvat_sdk/model/project_read_target_storage.py b/cvat-sdk/cvat_sdk/model/project_read_target_storage.py deleted file mode 100644 index 4113071b..00000000 --- a/cvat-sdk/cvat_sdk/model/project_read_target_storage.py +++ /dev/null @@ -1,380 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.location_enum import LocationEnum - from cvat_sdk.model.storage import Storage - - globals()["LocationEnum"] = LocationEnum - globals()["Storage"] = Storage - - -class ProjectReadTargetStorage(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "id": (int,), # noqa: E501 - "location": (LocationEnum,), # noqa: E501 - "cloud_storage_id": ( - int, - none_type, - ), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - id: int # noqa: E501 - """ - [optional] - """ - - location: LocationEnum # noqa: E501 - """ - [optional] - """ - - cloud_storage_id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "id": "id", # noqa: E501 - "location": "location", # noqa: E501 - "cloud_storage_id": "cloud_storage_id", # noqa: E501 - } - - read_only_vars = { - "id", # noqa: E501 - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs) -> ProjectReadTargetStorage: # noqa: E501 - """ProjectReadTargetStorage - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - location (LocationEnum): [optional] # noqa: E501 - cloud_storage_id (int, none_type): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - "_check_type": _check_type, - "_path_to_item": _path_to_item, - "_spec_property_naming": _spec_property_naming, - "_configuration": _configuration, - "_visited_composed_classes": self._visited_composed_classes, - } - required_args = {} - kwargs.update(required_args) - composed_info = validate_get_composed_info(constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if ( - var_name in discarded_args - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self._additional_properties_model_instances - ): - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - "_composed_instances", - "_var_name_to_model_instances", - "_additional_properties_model_instances", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ProjectReadTargetStorage - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - location (LocationEnum): [optional] # noqa: E501 - cloud_storage_id (int, none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - "_check_type": _check_type, - "_path_to_item": _path_to_item, - "_spec_property_naming": _spec_property_naming, - "_configuration": _configuration, - "_visited_composed_classes": self._visited_composed_classes, - } - required_args = {} - kwargs.update(required_args) - composed_info = validate_get_composed_info(constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if ( - var_name in discarded_args - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self._additional_properties_model_instances - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - "anyOf": [], - "allOf": [ - Storage, - ], - "oneOf": [], - } diff --git a/cvat-sdk/cvat_sdk/model/project_search.py b/cvat-sdk/cvat_sdk/model/project_search.py deleted file mode 100644 index 8a48c7fc..00000000 --- a/cvat-sdk/cvat_sdk/model/project_search.py +++ /dev/null @@ -1,316 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class ProjectSearch(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - id (int): [optional] # noqa: E501 - - name (str): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "id": (int,), # noqa: E501 - "name": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - id: int # noqa: E501 - """ - [optional] - """ - - name: str # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "id": "id", # noqa: E501 - "name": "name", # noqa: E501 - } - - read_only_vars = { - "id", # noqa: E501 - "name", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ProjectSearch - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ProjectSearch - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/project_write.py b/cvat-sdk/cvat_sdk/model/project_write.py deleted file mode 100644 index cea0a74c..00000000 --- a/cvat-sdk/cvat_sdk/model/project_write.py +++ /dev/null @@ -1,325 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class ProjectWrite(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - name (str): - - bug_tracker (str): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("name",): { - "max_length": 256, - }, - ("bug_tracker",): { - "max_length": 2000, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "name": (str,), # noqa: E501 - "bug_tracker": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - name: str # noqa: E501 - """ - """ - - bug_tracker: str # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "name": "name", # noqa: E501 - "bug_tracker": "bug_tracker", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 - """ProjectWrite - a model defined in OpenAPI - - Args: - name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bug_tracker (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, name, *args, **kwargs): # noqa: E501 - """ProjectWrite - a model defined in OpenAPI - - Args: - name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - bug_tracker (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/project_write_request.py b/cvat-sdk/cvat_sdk/model/project_write_request.py deleted file mode 100644 index 6930fb15..00000000 --- a/cvat-sdk/cvat_sdk/model/project_write_request.py +++ /dev/null @@ -1,412 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.patched_label_request import PatchedLabelRequest - from cvat_sdk.model.patched_project_write_request_target_storage import ( - PatchedProjectWriteRequestTargetStorage, - ) - - globals()["PatchedLabelRequest"] = PatchedLabelRequest - globals()["PatchedProjectWriteRequestTargetStorage"] = PatchedProjectWriteRequestTargetStorage - - -class ProjectWriteRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - name (str): - - labels ([PatchedLabelRequest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - - owner_id (int, none_type): [optional] # noqa: E501 - - assignee_id (int, none_type): [optional] # noqa: E501 - - bug_tracker (str): [optional] # noqa: E501 - - target_storage (PatchedProjectWriteRequestTargetStorage): [optional] # noqa: E501 - - source_storage (PatchedProjectWriteRequestTargetStorage): [optional] # noqa: E501 - - task_subsets ([str]): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("name",): { - "max_length": 256, - "min_length": 1, - }, - ("bug_tracker",): { - "max_length": 2000, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "name": (str,), # noqa: E501 - "labels": ([PatchedLabelRequest],), # noqa: E501 - "owner_id": ( - int, - none_type, - ), # noqa: E501 - "assignee_id": ( - int, - none_type, - ), # noqa: E501 - "bug_tracker": (str,), # noqa: E501 - "target_storage": (PatchedProjectWriteRequestTargetStorage,), # noqa: E501 - "source_storage": (PatchedProjectWriteRequestTargetStorage,), # noqa: E501 - "task_subsets": ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - name: str # noqa: E501 - """ - """ - - labels: typing.List[PatchedLabelRequest] # noqa: E501 - """ - [optional, default: []] - [PatchedLabelRequest] - """ - - owner_id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - assignee_id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - bug_tracker: str # noqa: E501 - """ - [optional] - """ - - target_storage: PatchedProjectWriteRequestTargetStorage # noqa: E501 - """ - [optional] - """ - - source_storage: PatchedProjectWriteRequestTargetStorage # noqa: E501 - """ - [optional] - """ - - task_subsets: typing.List[str] # noqa: E501 - """ - [optional] - [str] - """ - - attribute_map = { - "name": "name", # noqa: E501 - "labels": "labels", # noqa: E501 - "owner_id": "owner_id", # noqa: E501 - "assignee_id": "assignee_id", # noqa: E501 - "bug_tracker": "bug_tracker", # noqa: E501 - "target_storage": "target_storage", # noqa: E501 - "source_storage": "source_storage", # noqa: E501 - "task_subsets": "task_subsets", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 - """ProjectWriteRequest - a model defined in OpenAPI - - Args: - name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - labels ([PatchedLabelRequest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - owner_id (int, none_type): [optional] # noqa: E501 - assignee_id (int, none_type): [optional] # noqa: E501 - bug_tracker (str): [optional] # noqa: E501 - target_storage (PatchedProjectWriteRequestTargetStorage): [optional] # noqa: E501 - source_storage (PatchedProjectWriteRequestTargetStorage): [optional] # noqa: E501 - task_subsets ([str]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, name, *args, **kwargs): # noqa: E501 - """ProjectWriteRequest - a model defined in OpenAPI - - Args: - name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - labels ([PatchedLabelRequest]): [optional] if omitted the server will use the default value of [] # noqa: E501 - owner_id (int, none_type): [optional] # noqa: E501 - assignee_id (int, none_type): [optional] # noqa: E501 - bug_tracker (str): [optional] # noqa: E501 - target_storage (PatchedProjectWriteRequestTargetStorage): [optional] # noqa: E501 - source_storage (PatchedProjectWriteRequestTargetStorage): [optional] # noqa: E501 - task_subsets ([str]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/provider_type_enum.py b/cvat-sdk/cvat_sdk/model/provider_type_enum.py deleted file mode 100644 index f93cabdc..00000000 --- a/cvat-sdk/cvat_sdk/model/provider_type_enum.py +++ /dev/null @@ -1,311 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class ProviderTypeEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("value",): { - "AWS_S3_BUCKET": "AWS_S3_BUCKET", - "AZURE_CONTAINER": "AZURE_CONTAINER", - "GOOGLE_DRIVE": "GOOGLE_DRIVE", - "GOOGLE_CLOUD_STORAGE": "GOOGLE_CLOUD_STORAGE", - }, - } - - validations = {} - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "value": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """ProviderTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["AWS_S3_BUCKET", "AZURE_CONTAINER", "GOOGLE_DRIVE", "GOOGLE_CLOUD_STORAGE", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["AWS_S3_BUCKET", "AZURE_CONTAINER", "GOOGLE_DRIVE", "GOOGLE_CLOUD_STORAGE", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """ProviderTypeEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["AWS_S3_BUCKET", "AZURE_CONTAINER", "GOOGLE_DRIVE", "GOOGLE_CLOUD_STORAGE", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["AWS_S3_BUCKET", "AZURE_CONTAINER", "GOOGLE_DRIVE", "GOOGLE_CLOUD_STORAGE", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/cvat-sdk/cvat_sdk/model/rest_auth_detail.py b/cvat-sdk/cvat_sdk/model/rest_auth_detail.py deleted file mode 100644 index 29a9bd0f..00000000 --- a/cvat-sdk/cvat_sdk/model/rest_auth_detail.py +++ /dev/null @@ -1,304 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class RestAuthDetail(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - detail (str): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "detail": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - detail: str # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "detail": "detail", # noqa: E501 - } - - read_only_vars = { - "detail", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """RestAuthDetail - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - detail (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """RestAuthDetail - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - detail (str): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/restricted_register.py b/cvat-sdk/cvat_sdk/model/restricted_register.py deleted file mode 100644 index 1713f07d..00000000 --- a/cvat-sdk/cvat_sdk/model/restricted_register.py +++ /dev/null @@ -1,365 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.user_agreement import UserAgreement - - globals()["UserAgreement"] = UserAgreement - - -class RestrictedRegister(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - username (str): - - email (str): [optional] # noqa: E501 - - first_name (str): [optional] # noqa: E501 - - last_name (str): [optional] # noqa: E501 - - confirmations ([UserAgreement]): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("username",): { - "max_length": 150, - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "username": (str,), # noqa: E501 - "email": (str,), # noqa: E501 - "first_name": (str,), # noqa: E501 - "last_name": (str,), # noqa: E501 - "confirmations": ([UserAgreement],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - username: str # noqa: E501 - """ - """ - - email: str # noqa: E501 - """ - [optional] - """ - - first_name: str # noqa: E501 - """ - [optional] - """ - - last_name: str # noqa: E501 - """ - [optional] - """ - - confirmations: typing.List[UserAgreement] # noqa: E501 - """ - [optional] - [UserAgreement] - """ - - attribute_map = { - "username": "username", # noqa: E501 - "email": "email", # noqa: E501 - "first_name": "first_name", # noqa: E501 - "last_name": "last_name", # noqa: E501 - "confirmations": "confirmations", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, username, *args, **kwargs): # noqa: E501 - """RestrictedRegister - a model defined in OpenAPI - - Args: - username (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - email (str): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - confirmations ([UserAgreement]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.username = username - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, username, *args, **kwargs): # noqa: E501 - """RestrictedRegister - a model defined in OpenAPI - - Args: - username (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - email (str): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - confirmations ([UserAgreement]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.username = username - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/restricted_register_request.py b/cvat-sdk/cvat_sdk/model/restricted_register_request.py deleted file mode 100644 index 567dc30e..00000000 --- a/cvat-sdk/cvat_sdk/model/restricted_register_request.py +++ /dev/null @@ -1,404 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.user_agreement_request import UserAgreementRequest - - globals()["UserAgreementRequest"] = UserAgreementRequest - - -class RestrictedRegisterRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - username (str): - - password1 (str): - - password2 (str): - - email (str): [optional] # noqa: E501 - - first_name (str): [optional] # noqa: E501 - - last_name (str): [optional] # noqa: E501 - - confirmations ([UserAgreementRequest]): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("username",): { - "max_length": 150, - "min_length": 1, - }, - ("password1",): { - "min_length": 1, - }, - ("password2",): { - "min_length": 1, - }, - ("email",): { - "min_length": 1, - }, - ("first_name",): { - "min_length": 1, - }, - ("last_name",): { - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "username": (str,), # noqa: E501 - "password1": (str,), # noqa: E501 - "password2": (str,), # noqa: E501 - "email": (str,), # noqa: E501 - "first_name": (str,), # noqa: E501 - "last_name": (str,), # noqa: E501 - "confirmations": ([UserAgreementRequest],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - username: str # noqa: E501 - """ - """ - - email: str # noqa: E501 - """ - [optional] - """ - - password1: str # noqa: E501 - """ - """ - - password2: str # noqa: E501 - """ - """ - - first_name: str # noqa: E501 - """ - [optional] - """ - - last_name: str # noqa: E501 - """ - [optional] - """ - - confirmations: typing.List[UserAgreementRequest] # noqa: E501 - """ - [optional] - [UserAgreementRequest] - """ - - attribute_map = { - "username": "username", # noqa: E501 - "password1": "password1", # noqa: E501 - "password2": "password2", # noqa: E501 - "email": "email", # noqa: E501 - "first_name": "first_name", # noqa: E501 - "last_name": "last_name", # noqa: E501 - "confirmations": "confirmations", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, username, password1, password2, *args, **kwargs): # noqa: E501 - """RestrictedRegisterRequest - a model defined in OpenAPI - - Args: - username (str): - password1 (str): - password2 (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - email (str): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - confirmations ([UserAgreementRequest]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.username = username - self.password1 = password1 - self.password2 = password2 - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, username, password1, password2, *args, **kwargs): # noqa: E501 - """RestrictedRegisterRequest - a model defined in OpenAPI - - Args: - username (str): - password1 (str): - password2 (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - email (str): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - confirmations ([UserAgreementRequest]): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.username = username - self.password1 = password1 - self.password2 = password2 - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/role_enum.py b/cvat-sdk/cvat_sdk/model/role_enum.py deleted file mode 100644 index 6637e8e2..00000000 --- a/cvat-sdk/cvat_sdk/model/role_enum.py +++ /dev/null @@ -1,311 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class RoleEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("value",): { - "WORKER": "worker", - "SUPERVISOR": "supervisor", - "MAINTAINER": "maintainer", - "OWNER": "owner", - }, - } - - validations = {} - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "value": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """RoleEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["worker", "supervisor", "maintainer", "owner", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["worker", "supervisor", "maintainer", "owner", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """RoleEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["worker", "supervisor", "maintainer", "owner", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["worker", "supervisor", "maintainer", "owner", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/cvat-sdk/cvat_sdk/model/rq_status.py b/cvat-sdk/cvat_sdk/model/rq_status.py deleted file mode 100644 index 17577a51..00000000 --- a/cvat-sdk/cvat_sdk/model/rq_status.py +++ /dev/null @@ -1,341 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.rq_status_state_enum import RqStatusStateEnum - - globals()["RqStatusStateEnum"] = RqStatusStateEnum - - -class RqStatus(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - state (RqStatusStateEnum): - - message (str): [optional] if omitted the server will use the default value of "" # noqa: E501 - - progress (float): [optional] if omitted the server will use the default value of 0.0 # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("progress",): { - "inclusive_maximum": 100, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "state": (RqStatusStateEnum,), # noqa: E501 - "message": (str,), # noqa: E501 - "progress": (float,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - state: RqStatusStateEnum # noqa: E501 - """ - """ - - message: str # noqa: E501 - """ - [optional, default: ""] - """ - - progress: float # noqa: E501 - """ - [optional, default: 0.0] - """ - - attribute_map = { - "state": "state", # noqa: E501 - "message": "message", # noqa: E501 - "progress": "progress", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, state, *args, **kwargs): # noqa: E501 - """RqStatus - a model defined in OpenAPI - - Args: - state (RqStatusStateEnum): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - message (str): [optional] if omitted the server will use the default value of "" # noqa: E501 - progress (float): [optional] if omitted the server will use the default value of 0.0 # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.state = state - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, state, *args, **kwargs): # noqa: E501 - """RqStatus - a model defined in OpenAPI - - Args: - state (RqStatusStateEnum): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - message (str): [optional] if omitted the server will use the default value of "" # noqa: E501 - progress (float): [optional] if omitted the server will use the default value of 0.0 # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.state = state - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/rq_status_state_enum.py b/cvat-sdk/cvat_sdk/model/rq_status_state_enum.py deleted file mode 100644 index fd784395..00000000 --- a/cvat-sdk/cvat_sdk/model/rq_status_state_enum.py +++ /dev/null @@ -1,311 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class RqStatusStateEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("value",): { - "QUEUED": "Queued", - "STARTED": "Started", - "FINISHED": "Finished", - "FAILED": "Failed", - }, - } - - validations = {} - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "value": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """RqStatusStateEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["Queued", "Started", "Finished", "Failed", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["Queued", "Started", "Finished", "Failed", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """RqStatusStateEnum - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["Queued", "Started", "Finished", "Failed", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["Queued", "Started", "Finished", "Failed", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/cvat-sdk/cvat_sdk/model/segment.py b/cvat-sdk/cvat_sdk/model/segment.py deleted file mode 100644 index 15942cc6..00000000 --- a/cvat-sdk/cvat_sdk/model/segment.py +++ /dev/null @@ -1,341 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.simple_job import SimpleJob - - globals()["SimpleJob"] = SimpleJob - - -class Segment(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - jobs ([SimpleJob]): - - start_frame (int): [optional] # noqa: E501 - - stop_frame (int): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "jobs": ([SimpleJob],), # noqa: E501 - "start_frame": (int,), # noqa: E501 - "stop_frame": (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - start_frame: int # noqa: E501 - """ - [optional] - """ - - stop_frame: int # noqa: E501 - """ - [optional] - """ - - jobs: typing.List[SimpleJob] # noqa: E501 - """ - [SimpleJob] - """ - - attribute_map = { - "jobs": "jobs", # noqa: E501 - "start_frame": "start_frame", # noqa: E501 - "stop_frame": "stop_frame", # noqa: E501 - } - - read_only_vars = { - "start_frame", # noqa: E501 - "stop_frame", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, jobs, *args, **kwargs): # noqa: E501 - """Segment - a model defined in OpenAPI - - Args: - jobs ([SimpleJob]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - start_frame (int): [optional] # noqa: E501 - stop_frame (int): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.jobs = jobs - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, jobs, *args, **kwargs): # noqa: E501 - """Segment - a model defined in OpenAPI - - Args: - jobs ([SimpleJob]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - start_frame (int): [optional] # noqa: E501 - stop_frame (int): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.jobs = jobs - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/shape_type.py b/cvat-sdk/cvat_sdk/model/shape_type.py deleted file mode 100644 index 78721ca0..00000000 --- a/cvat-sdk/cvat_sdk/model/shape_type.py +++ /dev/null @@ -1,313 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class ShapeType(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("value",): { - "RECTANGLE": "rectangle", - "POLYGON": "polygon", - "POLYLINE": "polyline", - "POINTS": "points", - "ELLIPSE": "ellipse", - "CUBOID": "cuboid", - }, - } - - validations = {} - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "value": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """ShapeType - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["rectangle", "polygon", "polyline", "points", "ellipse", "cuboid", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["rectangle", "polygon", "polyline", "points", "ellipse", "cuboid", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """ShapeType - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["rectangle", "polygon", "polyline", "points", "ellipse", "cuboid", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["rectangle", "polygon", "polyline", "points", "ellipse", "cuboid", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/cvat-sdk/cvat_sdk/model/signing_request.py b/cvat-sdk/cvat_sdk/model/signing_request.py deleted file mode 100644 index d02a8f04..00000000 --- a/cvat-sdk/cvat_sdk/model/signing_request.py +++ /dev/null @@ -1,311 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class SigningRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - url (str): - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("url",): { - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "url": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - url: str # noqa: E501 - """ - """ - - attribute_map = { - "url": "url", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, url, *args, **kwargs): # noqa: E501 - """SigningRequest - a model defined in OpenAPI - - Args: - url (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.url = url - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, url, *args, **kwargs): # noqa: E501 - """SigningRequest - a model defined in OpenAPI - - Args: - url (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.url = url - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/simple_job.py b/cvat-sdk/cvat_sdk/model/simple_job.py deleted file mode 100644 index 2080687e..00000000 --- a/cvat-sdk/cvat_sdk/model/simple_job.py +++ /dev/null @@ -1,412 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.comment_read_owner import CommentReadOwner - from cvat_sdk.model.job_stage import JobStage - from cvat_sdk.model.job_status import JobStatus - from cvat_sdk.model.operation_status import OperationStatus - - globals()["CommentReadOwner"] = CommentReadOwner - globals()["JobStage"] = JobStage - globals()["JobStatus"] = JobStatus - globals()["OperationStatus"] = OperationStatus - - -class SimpleJob(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - assignee (CommentReadOwner): - - url (str): [optional] # noqa: E501 - - id (int): [optional] # noqa: E501 - - status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - - stage (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - - state (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "assignee": (CommentReadOwner,), # noqa: E501 - "url": (str,), # noqa: E501 - "id": (int,), # noqa: E501 - "status": ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ), # noqa: E501 - "stage": ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ), # noqa: E501 - "state": ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - url: str # noqa: E501 - """ - [optional] - """ - - id: int # noqa: E501 - """ - [optional] - """ - - assignee: CommentReadOwner # noqa: E501 - """ - """ - - status: typing.Union[typing.Any, none_type] # noqa: E501 - """ - [optional] - """ - - stage: typing.Union[typing.Any, none_type] # noqa: E501 - """ - [optional] - """ - - state: typing.Union[typing.Any, none_type] # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "assignee": "assignee", # noqa: E501 - "url": "url", # noqa: E501 - "id": "id", # noqa: E501 - "status": "status", # noqa: E501 - "stage": "stage", # noqa: E501 - "state": "state", # noqa: E501 - } - - read_only_vars = { - "url", # noqa: E501 - "id", # noqa: E501 - "status", # noqa: E501 - "stage", # noqa: E501 - "state", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, assignee, *args, **kwargs): # noqa: E501 - """SimpleJob - a model defined in OpenAPI - - Args: - assignee (CommentReadOwner): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - stage (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - state (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.assignee = assignee - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, assignee, *args, **kwargs): # noqa: E501 - """SimpleJob - a model defined in OpenAPI - - Args: - assignee (CommentReadOwner): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - stage (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - state (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.assignee = assignee - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/sorting_method.py b/cvat-sdk/cvat_sdk/model/sorting_method.py deleted file mode 100644 index f3c4f96f..00000000 --- a/cvat-sdk/cvat_sdk/model/sorting_method.py +++ /dev/null @@ -1,311 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class SortingMethod(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("value",): { - "LEXICOGRAPHICAL": "lexicographical", - "NATURAL": "natural", - "PREDEFINED": "predefined", - "RANDOM": "random", - }, - } - - validations = {} - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "value": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """SortingMethod - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["lexicographical", "natural", "predefined", "random", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["lexicographical", "natural", "predefined", "random", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """SortingMethod - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["lexicographical", "natural", "predefined", "random", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["lexicographical", "natural", "predefined", "random", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/cvat-sdk/cvat_sdk/model/storage.py b/cvat-sdk/cvat_sdk/model/storage.py deleted file mode 100644 index cf8d6c9a..00000000 --- a/cvat-sdk/cvat_sdk/model/storage.py +++ /dev/null @@ -1,337 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.location_enum import LocationEnum - - globals()["LocationEnum"] = LocationEnum - - -class Storage(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - id (int): [optional] # noqa: E501 - - location (LocationEnum): [optional] # noqa: E501 - - cloud_storage_id (int, none_type): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "id": (int,), # noqa: E501 - "location": (LocationEnum,), # noqa: E501 - "cloud_storage_id": ( - int, - none_type, - ), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - id: int # noqa: E501 - """ - [optional] - """ - - location: LocationEnum # noqa: E501 - """ - [optional] - """ - - cloud_storage_id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "id": "id", # noqa: E501 - "location": "location", # noqa: E501 - "cloud_storage_id": "cloud_storage_id", # noqa: E501 - } - - read_only_vars = { - "id", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """Storage - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - location (LocationEnum): [optional] # noqa: E501 - cloud_storage_id (int, none_type): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """Storage - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - location (LocationEnum): [optional] # noqa: E501 - cloud_storage_id (int, none_type): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/storage_method.py b/cvat-sdk/cvat_sdk/model/storage_method.py deleted file mode 100644 index a6af80c5..00000000 --- a/cvat-sdk/cvat_sdk/model/storage_method.py +++ /dev/null @@ -1,309 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class StorageMethod(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("value",): { - "CACHE": "cache", - "FILE_SYSTEM": "file_system", - }, - } - - validations = {} - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "value": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """StorageMethod - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["cache", "file_system", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["cache", "file_system", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """StorageMethod - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["cache", "file_system", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["cache", "file_system", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/cvat-sdk/cvat_sdk/model/storage_request.py b/cvat-sdk/cvat_sdk/model/storage_request.py deleted file mode 100644 index 8f134469..00000000 --- a/cvat-sdk/cvat_sdk/model/storage_request.py +++ /dev/null @@ -1,324 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.location_enum import LocationEnum - - globals()["LocationEnum"] = LocationEnum - - -class StorageRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - location (LocationEnum): [optional] # noqa: E501 - - cloud_storage_id (int, none_type): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "location": (LocationEnum,), # noqa: E501 - "cloud_storage_id": ( - int, - none_type, - ), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - location: LocationEnum # noqa: E501 - """ - [optional] - """ - - cloud_storage_id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "location": "location", # noqa: E501 - "cloud_storage_id": "cloud_storage_id", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """StorageRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - location (LocationEnum): [optional] # noqa: E501 - cloud_storage_id (int, none_type): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """StorageRequest - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - location (LocationEnum): [optional] # noqa: E501 - cloud_storage_id (int, none_type): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/storage_type.py b/cvat-sdk/cvat_sdk/model/storage_type.py deleted file mode 100644 index 65928326..00000000 --- a/cvat-sdk/cvat_sdk/model/storage_type.py +++ /dev/null @@ -1,310 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class StorageType(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("value",): { - "CLOUD_STORAGE": "cloud_storage", - "LOCAL": "local", - "SHARE": "share", - }, - } - - validations = {} - - additional_properties_type = None - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "value": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = {} - - read_only_vars = set() - - _composed_schemas = None - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """StorageType - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["cloud_storage", "local", "share", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["cloud_storage", "local", "share", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """StorageType - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - - Args: - args[0] (str):, must be one of ["cloud_storage", "local", "share", ] # noqa: E501 - - Keyword Args: - value (str):, must be one of ["cloud_storage", "local", "share", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.value = value - if kwargs: - raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % ( - kwargs, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - return self diff --git a/cvat-sdk/cvat_sdk/model/task_file_request.py b/cvat-sdk/cvat_sdk/model/task_file_request.py deleted file mode 100644 index 010e3b79..00000000 --- a/cvat-sdk/cvat_sdk/model/task_file_request.py +++ /dev/null @@ -1,307 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class TaskFileRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - task_file (file_type): - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "task_file": (file_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - task_file: file_type # noqa: E501 - """ - """ - - attribute_map = { - "task_file": "task_file", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, task_file, *args, **kwargs): # noqa: E501 - """TaskFileRequest - a model defined in OpenAPI - - Args: - task_file (file_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.task_file = task_file - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, task_file, *args, **kwargs): # noqa: E501 - """TaskFileRequest - a model defined in OpenAPI - - Args: - task_file (file_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.task_file = task_file - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/task_read.py b/cvat-sdk/cvat_sdk/model/task_read.py deleted file mode 100644 index 1d17420b..00000000 --- a/cvat-sdk/cvat_sdk/model/task_read.py +++ /dev/null @@ -1,658 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.basic_user import BasicUser - from cvat_sdk.model.chunk_type import ChunkType - from cvat_sdk.model.comment_read_owner import CommentReadOwner - from cvat_sdk.model.job_status import JobStatus - from cvat_sdk.model.label import Label - from cvat_sdk.model.segment import Segment - from cvat_sdk.model.task_read_target_storage import TaskReadTargetStorage - - globals()["BasicUser"] = BasicUser - globals()["ChunkType"] = ChunkType - globals()["CommentReadOwner"] = CommentReadOwner - globals()["JobStatus"] = JobStatus - globals()["Label"] = Label - globals()["Segment"] = Segment - globals()["TaskReadTargetStorage"] = TaskReadTargetStorage - - -class TaskRead(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - url (str): [optional] # noqa: E501 - - id (int): [optional] # noqa: E501 - - name (str): [optional] # noqa: E501 - - project_id (int, none_type): [optional] # noqa: E501 - - mode (str): [optional] # noqa: E501 - - owner (BasicUser): [optional] # noqa: E501 - - assignee (CommentReadOwner): [optional] # noqa: E501 - - bug_tracker (str): [optional] # noqa: E501 - - created_date (datetime): [optional] # noqa: E501 - - updated_date (datetime): [optional] # noqa: E501 - - overlap (int): [optional] # noqa: E501 - - segment_size (int): [optional] # noqa: E501 - - status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - - labels ([Label]): [optional] # noqa: E501 - - segments ([Segment]): [optional] # noqa: E501 - - data_chunk_size (int, none_type): [optional] # noqa: E501 - - data_compressed_chunk_type (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - - data_original_chunk_type (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - - size (int): [optional] # noqa: E501 - - image_quality (int): [optional] # noqa: E501 - - data (int): [optional] # noqa: E501 - - dimension (str): [optional] # noqa: E501 - - subset (str): [optional] # noqa: E501 - - organization (int, none_type): [optional] # noqa: E501 - - target_storage (TaskReadTargetStorage): [optional] # noqa: E501 - - source_storage (TaskReadTargetStorage): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "url": (str,), # noqa: E501 - "id": (int,), # noqa: E501 - "name": (str,), # noqa: E501 - "project_id": ( - int, - none_type, - ), # noqa: E501 - "mode": (str,), # noqa: E501 - "owner": (BasicUser,), # noqa: E501 - "assignee": (CommentReadOwner,), # noqa: E501 - "bug_tracker": (str,), # noqa: E501 - "created_date": (datetime,), # noqa: E501 - "updated_date": (datetime,), # noqa: E501 - "overlap": (int,), # noqa: E501 - "segment_size": (int,), # noqa: E501 - "status": ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ), # noqa: E501 - "labels": ([Label],), # noqa: E501 - "segments": ([Segment],), # noqa: E501 - "data_chunk_size": ( - int, - none_type, - ), # noqa: E501 - "data_compressed_chunk_type": ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ), # noqa: E501 - "data_original_chunk_type": ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ), # noqa: E501 - "size": (int,), # noqa: E501 - "image_quality": (int,), # noqa: E501 - "data": (int,), # noqa: E501 - "dimension": (str,), # noqa: E501 - "subset": (str,), # noqa: E501 - "organization": ( - int, - none_type, - ), # noqa: E501 - "target_storage": (TaskReadTargetStorage,), # noqa: E501 - "source_storage": (TaskReadTargetStorage,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - url: str # noqa: E501 - """ - [optional] - """ - - id: int # noqa: E501 - """ - [optional] - """ - - name: str # noqa: E501 - """ - [optional] - """ - - project_id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - mode: str # noqa: E501 - """ - [optional] - """ - - owner: BasicUser # noqa: E501 - """ - [optional] - """ - - assignee: CommentReadOwner # noqa: E501 - """ - [optional] - """ - - bug_tracker: str # noqa: E501 - """ - [optional] - """ - - created_date: datetime # noqa: E501 - """ - [optional] - """ - - updated_date: datetime # noqa: E501 - """ - [optional] - """ - - overlap: int # noqa: E501 - """ - [optional] - """ - - segment_size: int # noqa: E501 - """ - [optional] - """ - - status: typing.Union[typing.Any, none_type] # noqa: E501 - """ - [optional] - """ - - labels: typing.List[Label] # noqa: E501 - """ - [optional] - [Label] - """ - - segments: typing.List[Segment] # noqa: E501 - """ - [optional] - [Segment] - """ - - data_chunk_size: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - data_compressed_chunk_type: typing.Union[typing.Any, none_type] # noqa: E501 - """ - [optional] - """ - - data_original_chunk_type: typing.Union[typing.Any, none_type] # noqa: E501 - """ - [optional] - """ - - size: int # noqa: E501 - """ - [optional] - """ - - image_quality: int # noqa: E501 - """ - [optional] - """ - - data: int # noqa: E501 - """ - [optional] - """ - - dimension: str # noqa: E501 - """ - [optional] - """ - - subset: str # noqa: E501 - """ - [optional] - """ - - organization: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - target_storage: TaskReadTargetStorage # noqa: E501 - """ - [optional] - """ - - source_storage: TaskReadTargetStorage # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "url": "url", # noqa: E501 - "id": "id", # noqa: E501 - "name": "name", # noqa: E501 - "project_id": "project_id", # noqa: E501 - "mode": "mode", # noqa: E501 - "owner": "owner", # noqa: E501 - "assignee": "assignee", # noqa: E501 - "bug_tracker": "bug_tracker", # noqa: E501 - "created_date": "created_date", # noqa: E501 - "updated_date": "updated_date", # noqa: E501 - "overlap": "overlap", # noqa: E501 - "segment_size": "segment_size", # noqa: E501 - "status": "status", # noqa: E501 - "labels": "labels", # noqa: E501 - "segments": "segments", # noqa: E501 - "data_chunk_size": "data_chunk_size", # noqa: E501 - "data_compressed_chunk_type": "data_compressed_chunk_type", # noqa: E501 - "data_original_chunk_type": "data_original_chunk_type", # noqa: E501 - "size": "size", # noqa: E501 - "image_quality": "image_quality", # noqa: E501 - "data": "data", # noqa: E501 - "dimension": "dimension", # noqa: E501 - "subset": "subset", # noqa: E501 - "organization": "organization", # noqa: E501 - "target_storage": "target_storage", # noqa: E501 - "source_storage": "source_storage", # noqa: E501 - } - - read_only_vars = { - "url", # noqa: E501 - "id", # noqa: E501 - "name", # noqa: E501 - "mode", # noqa: E501 - "bug_tracker", # noqa: E501 - "created_date", # noqa: E501 - "updated_date", # noqa: E501 - "overlap", # noqa: E501 - "segment_size", # noqa: E501 - "status", # noqa: E501 - "segments", # noqa: E501 - "data_chunk_size", # noqa: E501 - "data_compressed_chunk_type", # noqa: E501 - "data_original_chunk_type", # noqa: E501 - "size", # noqa: E501 - "image_quality", # noqa: E501 - "data", # noqa: E501 - "subset", # noqa: E501 - "organization", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """TaskRead - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - project_id (int, none_type): [optional] # noqa: E501 - mode (str): [optional] # noqa: E501 - owner (BasicUser): [optional] # noqa: E501 - assignee (CommentReadOwner): [optional] # noqa: E501 - bug_tracker (str): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - overlap (int): [optional] # noqa: E501 - segment_size (int): [optional] # noqa: E501 - status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - labels ([Label]): [optional] # noqa: E501 - segments ([Segment]): [optional] # noqa: E501 - data_chunk_size (int, none_type): [optional] # noqa: E501 - data_compressed_chunk_type (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - data_original_chunk_type (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - size (int): [optional] # noqa: E501 - image_quality (int): [optional] # noqa: E501 - data (int): [optional] # noqa: E501 - dimension (str): [optional] # noqa: E501 - subset (str): [optional] # noqa: E501 - organization (int, none_type): [optional] # noqa: E501 - target_storage (TaskReadTargetStorage): [optional] # noqa: E501 - source_storage (TaskReadTargetStorage): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TaskRead - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - project_id (int, none_type): [optional] # noqa: E501 - mode (str): [optional] # noqa: E501 - owner (BasicUser): [optional] # noqa: E501 - assignee (CommentReadOwner): [optional] # noqa: E501 - bug_tracker (str): [optional] # noqa: E501 - created_date (datetime): [optional] # noqa: E501 - updated_date (datetime): [optional] # noqa: E501 - overlap (int): [optional] # noqa: E501 - segment_size (int): [optional] # noqa: E501 - status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - labels ([Label]): [optional] # noqa: E501 - segments ([Segment]): [optional] # noqa: E501 - data_chunk_size (int, none_type): [optional] # noqa: E501 - data_compressed_chunk_type (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - data_original_chunk_type (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501 - size (int): [optional] # noqa: E501 - image_quality (int): [optional] # noqa: E501 - data (int): [optional] # noqa: E501 - dimension (str): [optional] # noqa: E501 - subset (str): [optional] # noqa: E501 - organization (int, none_type): [optional] # noqa: E501 - target_storage (TaskReadTargetStorage): [optional] # noqa: E501 - source_storage (TaskReadTargetStorage): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/task_read_target_storage.py b/cvat-sdk/cvat_sdk/model/task_read_target_storage.py deleted file mode 100644 index a5a5b8e2..00000000 --- a/cvat-sdk/cvat_sdk/model/task_read_target_storage.py +++ /dev/null @@ -1,380 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.location_enum import LocationEnum - from cvat_sdk.model.storage import Storage - - globals()["LocationEnum"] = LocationEnum - globals()["Storage"] = Storage - - -class TaskReadTargetStorage(ModelComposed): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "id": (int,), # noqa: E501 - "location": (LocationEnum,), # noqa: E501 - "cloud_storage_id": ( - int, - none_type, - ), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - id: int # noqa: E501 - """ - [optional] - """ - - location: LocationEnum # noqa: E501 - """ - [optional] - """ - - cloud_storage_id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "id": "id", # noqa: E501 - "location": "location", # noqa: E501 - "cloud_storage_id": "cloud_storage_id", # noqa: E501 - } - - read_only_vars = { - "id", # noqa: E501 - } - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs) -> TaskReadTargetStorage: # noqa: E501 - """TaskReadTargetStorage - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - location (LocationEnum): [optional] # noqa: E501 - cloud_storage_id (int, none_type): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - "_check_type": _check_type, - "_path_to_item": _path_to_item, - "_spec_property_naming": _spec_property_naming, - "_configuration": _configuration, - "_visited_composed_classes": self._visited_composed_classes, - } - required_args = {} - kwargs.update(required_args) - composed_info = validate_get_composed_info(constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if ( - var_name in discarded_args - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self._additional_properties_model_instances - ): - # discard variable. - continue - setattr(self, var_name, var_value) - - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - "_composed_instances", - "_var_name_to_model_instances", - "_additional_properties_model_instances", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """TaskReadTargetStorage - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (int): [optional] # noqa: E501 - location (LocationEnum): [optional] # noqa: E501 - cloud_storage_id (int, none_type): [optional] # noqa: E501 - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - constant_args = { - "_check_type": _check_type, - "_path_to_item": _path_to_item, - "_spec_property_naming": _spec_property_naming, - "_configuration": _configuration, - "_visited_composed_classes": self._visited_composed_classes, - } - required_args = {} - kwargs.update(required_args) - composed_info = validate_get_composed_info(constant_args, kwargs, self) - self._composed_instances = composed_info[0] - self._var_name_to_model_instances = composed_info[1] - self._additional_properties_model_instances = composed_info[2] - discarded_args = composed_info[3] - - for var_name, var_value in kwargs.items(): - if ( - var_name in discarded_args - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self._additional_properties_model_instances - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) - - @cached_property - def _composed_schemas(): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - lazy_import() - return { - "anyOf": [], - "allOf": [ - Storage, - ], - "oneOf": [], - } diff --git a/cvat-sdk/cvat_sdk/model/task_write.py b/cvat-sdk/cvat_sdk/model/task_write.py deleted file mode 100644 index dc1a469c..00000000 --- a/cvat-sdk/cvat_sdk/model/task_write.py +++ /dev/null @@ -1,447 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.label import Label - from cvat_sdk.model.task_read_target_storage import TaskReadTargetStorage - - globals()["Label"] = Label - globals()["TaskReadTargetStorage"] = TaskReadTargetStorage - - -class TaskWrite(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - name (str): - - url (str): [optional] # noqa: E501 - - id (int): [optional] # noqa: E501 - - project_id (int, none_type): [optional] # noqa: E501 - - bug_tracker (str): [optional] # noqa: E501 - - overlap (int, none_type): [optional] # noqa: E501 - - segment_size (int): [optional] # noqa: E501 - - labels ([Label]): [optional] # noqa: E501 - - subset (str): [optional] # noqa: E501 - - target_storage (TaskReadTargetStorage): [optional] # noqa: E501 - - source_storage (TaskReadTargetStorage): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("name",): { - "max_length": 256, - }, - ("bug_tracker",): { - "max_length": 2000, - }, - ("subset",): { - "max_length": 64, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "name": (str,), # noqa: E501 - "url": (str,), # noqa: E501 - "id": (int,), # noqa: E501 - "project_id": ( - int, - none_type, - ), # noqa: E501 - "bug_tracker": (str,), # noqa: E501 - "overlap": ( - int, - none_type, - ), # noqa: E501 - "segment_size": (int,), # noqa: E501 - "labels": ([Label],), # noqa: E501 - "subset": (str,), # noqa: E501 - "target_storage": (TaskReadTargetStorage,), # noqa: E501 - "source_storage": (TaskReadTargetStorage,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - url: str # noqa: E501 - """ - [optional] - """ - - id: int # noqa: E501 - """ - [optional] - """ - - name: str # noqa: E501 - """ - """ - - project_id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - bug_tracker: str # noqa: E501 - """ - [optional] - """ - - overlap: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - segment_size: int # noqa: E501 - """ - [optional] - """ - - labels: typing.List[Label] # noqa: E501 - """ - [optional] - [Label] - """ - - subset: str # noqa: E501 - """ - [optional] - """ - - target_storage: TaskReadTargetStorage # noqa: E501 - """ - [optional] - """ - - source_storage: TaskReadTargetStorage # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "name": "name", # noqa: E501 - "url": "url", # noqa: E501 - "id": "id", # noqa: E501 - "project_id": "project_id", # noqa: E501 - "bug_tracker": "bug_tracker", # noqa: E501 - "overlap": "overlap", # noqa: E501 - "segment_size": "segment_size", # noqa: E501 - "labels": "labels", # noqa: E501 - "subset": "subset", # noqa: E501 - "target_storage": "target_storage", # noqa: E501 - "source_storage": "source_storage", # noqa: E501 - } - - read_only_vars = { - "url", # noqa: E501 - "id", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 - """TaskWrite - a model defined in OpenAPI - - Args: - name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - project_id (int, none_type): [optional] # noqa: E501 - bug_tracker (str): [optional] # noqa: E501 - overlap (int, none_type): [optional] # noqa: E501 - segment_size (int): [optional] # noqa: E501 - labels ([Label]): [optional] # noqa: E501 - subset (str): [optional] # noqa: E501 - target_storage (TaskReadTargetStorage): [optional] # noqa: E501 - source_storage (TaskReadTargetStorage): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, name, *args, **kwargs): # noqa: E501 - """TaskWrite - a model defined in OpenAPI - - Args: - name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - project_id (int, none_type): [optional] # noqa: E501 - bug_tracker (str): [optional] # noqa: E501 - overlap (int, none_type): [optional] # noqa: E501 - segment_size (int): [optional] # noqa: E501 - labels ([Label]): [optional] # noqa: E501 - subset (str): [optional] # noqa: E501 - target_storage (TaskReadTargetStorage): [optional] # noqa: E501 - source_storage (TaskReadTargetStorage): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/task_write_request.py b/cvat-sdk/cvat_sdk/model/task_write_request.py deleted file mode 100644 index 2c9cd80b..00000000 --- a/cvat-sdk/cvat_sdk/model/task_write_request.py +++ /dev/null @@ -1,453 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.patched_label_request import PatchedLabelRequest - from cvat_sdk.model.patched_task_write_request_target_storage import ( - PatchedTaskWriteRequestTargetStorage, - ) - - globals()["PatchedLabelRequest"] = PatchedLabelRequest - globals()["PatchedTaskWriteRequestTargetStorage"] = PatchedTaskWriteRequestTargetStorage - - -class TaskWriteRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - name (str): - - project_id (int, none_type): [optional] # noqa: E501 - - owner_id (int, none_type): [optional] # noqa: E501 - - assignee_id (int, none_type): [optional] # noqa: E501 - - bug_tracker (str): [optional] # noqa: E501 - - overlap (int, none_type): [optional] # noqa: E501 - - segment_size (int): [optional] # noqa: E501 - - labels ([PatchedLabelRequest]): [optional] # noqa: E501 - - subset (str): [optional] # noqa: E501 - - target_storage (PatchedTaskWriteRequestTargetStorage): [optional] # noqa: E501 - - source_storage (PatchedTaskWriteRequestTargetStorage): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("name",): { - "max_length": 256, - "min_length": 1, - }, - ("bug_tracker",): { - "max_length": 2000, - }, - ("subset",): { - "max_length": 64, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "name": (str,), # noqa: E501 - "project_id": ( - int, - none_type, - ), # noqa: E501 - "owner_id": ( - int, - none_type, - ), # noqa: E501 - "assignee_id": ( - int, - none_type, - ), # noqa: E501 - "bug_tracker": (str,), # noqa: E501 - "overlap": ( - int, - none_type, - ), # noqa: E501 - "segment_size": (int,), # noqa: E501 - "labels": ([PatchedLabelRequest],), # noqa: E501 - "subset": (str,), # noqa: E501 - "target_storage": (PatchedTaskWriteRequestTargetStorage,), # noqa: E501 - "source_storage": (PatchedTaskWriteRequestTargetStorage,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - name: str # noqa: E501 - """ - """ - - project_id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - owner_id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - assignee_id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - bug_tracker: str # noqa: E501 - """ - [optional] - """ - - overlap: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - segment_size: int # noqa: E501 - """ - [optional] - """ - - labels: typing.List[PatchedLabelRequest] # noqa: E501 - """ - [optional] - [PatchedLabelRequest] - """ - - subset: str # noqa: E501 - """ - [optional] - """ - - target_storage: PatchedTaskWriteRequestTargetStorage # noqa: E501 - """ - [optional] - """ - - source_storage: PatchedTaskWriteRequestTargetStorage # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "name": "name", # noqa: E501 - "project_id": "project_id", # noqa: E501 - "owner_id": "owner_id", # noqa: E501 - "assignee_id": "assignee_id", # noqa: E501 - "bug_tracker": "bug_tracker", # noqa: E501 - "overlap": "overlap", # noqa: E501 - "segment_size": "segment_size", # noqa: E501 - "labels": "labels", # noqa: E501 - "subset": "subset", # noqa: E501 - "target_storage": "target_storage", # noqa: E501 - "source_storage": "source_storage", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 - """TaskWriteRequest - a model defined in OpenAPI - - Args: - name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - project_id (int, none_type): [optional] # noqa: E501 - owner_id (int, none_type): [optional] # noqa: E501 - assignee_id (int, none_type): [optional] # noqa: E501 - bug_tracker (str): [optional] # noqa: E501 - overlap (int, none_type): [optional] # noqa: E501 - segment_size (int): [optional] # noqa: E501 - labels ([PatchedLabelRequest]): [optional] # noqa: E501 - subset (str): [optional] # noqa: E501 - target_storage (PatchedTaskWriteRequestTargetStorage): [optional] # noqa: E501 - source_storage (PatchedTaskWriteRequestTargetStorage): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, name, *args, **kwargs): # noqa: E501 - """TaskWriteRequest - a model defined in OpenAPI - - Args: - name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - project_id (int, none_type): [optional] # noqa: E501 - owner_id (int, none_type): [optional] # noqa: E501 - assignee_id (int, none_type): [optional] # noqa: E501 - bug_tracker (str): [optional] # noqa: E501 - overlap (int, none_type): [optional] # noqa: E501 - segment_size (int): [optional] # noqa: E501 - labels ([PatchedLabelRequest]): [optional] # noqa: E501 - subset (str): [optional] # noqa: E501 - target_storage (PatchedTaskWriteRequestTargetStorage): [optional] # noqa: E501 - source_storage (PatchedTaskWriteRequestTargetStorage): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/token.py b/cvat-sdk/cvat_sdk/model/token.py deleted file mode 100644 index c726c009..00000000 --- a/cvat-sdk/cvat_sdk/model/token.py +++ /dev/null @@ -1,311 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class Token(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - key (str): - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("key",): { - "max_length": 40, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "key": (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - key: str # noqa: E501 - """ - """ - - attribute_map = { - "key": "key", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, key, *args, **kwargs): # noqa: E501 - """Token - a model defined in OpenAPI - - Args: - key (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.key = key - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, key, *args, **kwargs): # noqa: E501 - """Token - a model defined in OpenAPI - - Args: - key (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.key = key - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/tracked_shape.py b/cvat-sdk/cvat_sdk/model/tracked_shape.py deleted file mode 100644 index 3eded0bc..00000000 --- a/cvat-sdk/cvat_sdk/model/tracked_shape.py +++ /dev/null @@ -1,427 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -def lazy_import(): - from cvat_sdk.model.attribute_val import AttributeVal - from cvat_sdk.model.shape_type import ShapeType - - globals()["AttributeVal"] = AttributeVal - globals()["ShapeType"] = ShapeType - - -class TrackedShape(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - type (ShapeType): - - occluded (bool): - - points ([float]): - - frame (int): - - outside (bool): - - attributes ([AttributeVal]): - - z_order (int): [optional] if omitted the server will use the default value of 0 # noqa: E501 - - rotation (float): [optional] if omitted the server will use the default value of 0.0 # noqa: E501 - - id (int, none_type): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("frame",): { - "inclusive_minimum": 0, - }, - ("rotation",): { - "inclusive_maximum": 360, - "inclusive_minimum": 0, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "type": (ShapeType,), # noqa: E501 - "occluded": (bool,), # noqa: E501 - "points": ([float],), # noqa: E501 - "frame": (int,), # noqa: E501 - "outside": (bool,), # noqa: E501 - "attributes": ([AttributeVal],), # noqa: E501 - "z_order": (int,), # noqa: E501 - "rotation": (float,), # noqa: E501 - "id": ( - int, - none_type, - ), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - type: ShapeType # noqa: E501 - """ - """ - - occluded: bool # noqa: E501 - """ - """ - - z_order: int # noqa: E501 - """ - [optional, default: 0] - """ - - rotation: float # noqa: E501 - """ - [optional, default: 0.0] - """ - - points: typing.List[float] # noqa: E501 - """ - [float] - """ - - id: typing.Union[int, none_type] # noqa: E501 - """ - [optional] - """ - - frame: int # noqa: E501 - """ - """ - - outside: bool # noqa: E501 - """ - """ - - attributes: typing.List[AttributeVal] # noqa: E501 - """ - [AttributeVal] - """ - - attribute_map = { - "type": "type", # noqa: E501 - "occluded": "occluded", # noqa: E501 - "points": "points", # noqa: E501 - "frame": "frame", # noqa: E501 - "outside": "outside", # noqa: E501 - "attributes": "attributes", # noqa: E501 - "z_order": "z_order", # noqa: E501 - "rotation": "rotation", # noqa: E501 - "id": "id", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data( - cls, type, occluded, points, frame, outside, attributes, *args, **kwargs - ): # noqa: E501 - """TrackedShape - a model defined in OpenAPI - - Args: - type (ShapeType): - occluded (bool): - points ([float]): - frame (int): - outside (bool): - attributes ([AttributeVal]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - z_order (int): [optional] if omitted the server will use the default value of 0 # noqa: E501 - rotation (float): [optional] if omitted the server will use the default value of 0.0 # noqa: E501 - id (int, none_type): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - self.occluded = occluded - self.points = points - self.frame = frame - self.outside = outside - self.attributes = attributes - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__( - self, type, occluded, points, frame, outside, attributes, *args, **kwargs - ): # noqa: E501 - """TrackedShape - a model defined in OpenAPI - - Args: - type (ShapeType): - occluded (bool): - points ([float]): - frame (int): - outside (bool): - attributes ([AttributeVal]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - z_order (int): [optional] if omitted the server will use the default value of 0 # noqa: E501 - rotation (float): [optional] if omitted the server will use the default value of 0.0 # noqa: E501 - id (int, none_type): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - self.occluded = occluded - self.points = points - self.frame = frame - self.outside = outside - self.attributes = attributes - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/user.py b/cvat-sdk/cvat_sdk/model/user.py deleted file mode 100644 index 76555341..00000000 --- a/cvat-sdk/cvat_sdk/model/user.py +++ /dev/null @@ -1,455 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class User(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - username (str): Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - - groups ([str]): - - url (str): [optional] # noqa: E501 - - id (int): [optional] # noqa: E501 - - first_name (str): [optional] # noqa: E501 - - last_name (str): [optional] # noqa: E501 - - email (str): [optional] # noqa: E501 - - is_staff (bool): Designates whether the user can log into this admin site.. [optional] # noqa: E501 - - is_superuser (bool): Designates that this user has all permissions without explicitly assigning them.. [optional] # noqa: E501 - - is_active (bool): Designates whether this user should be treated as active. Unselect this instead of deleting accounts.. [optional] # noqa: E501 - - last_login (datetime): [optional] # noqa: E501 - - date_joined (datetime): [optional] # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("username",): { - "max_length": 150, - "regex": { - "pattern": r"^[\w.@+-]+$", # noqa: E501 - }, - }, - ("first_name",): { - "max_length": 150, - }, - ("last_name",): { - "max_length": 150, - }, - ("email",): { - "max_length": 254, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "username": (str,), # noqa: E501 - "groups": ([str],), # noqa: E501 - "url": (str,), # noqa: E501 - "id": (int,), # noqa: E501 - "first_name": (str,), # noqa: E501 - "last_name": (str,), # noqa: E501 - "email": (str,), # noqa: E501 - "is_staff": (bool,), # noqa: E501 - "is_superuser": (bool,), # noqa: E501 - "is_active": (bool,), # noqa: E501 - "last_login": (datetime,), # noqa: E501 - "date_joined": (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - url: str # noqa: E501 - """ - [optional] - """ - - id: int # noqa: E501 - """ - [optional] - """ - - username: str # noqa: E501 - """ - Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.. - """ - - first_name: str # noqa: E501 - """ - [optional] - """ - - last_name: str # noqa: E501 - """ - [optional] - """ - - email: str # noqa: E501 - """ - [optional] - """ - - groups: typing.List[str] # noqa: E501 - """ - [str] - """ - - is_staff: bool # noqa: E501 - """ - [optional] - Designates whether the user can log into this admin site.. - """ - - is_superuser: bool # noqa: E501 - """ - [optional] - Designates that this user has all permissions without explicitly assigning them.. - """ - - is_active: bool # noqa: E501 - """ - [optional] - Designates whether this user should be treated as active. Unselect this instead of deleting accounts.. - """ - - last_login: datetime # noqa: E501 - """ - [optional] - """ - - date_joined: datetime # noqa: E501 - """ - [optional] - """ - - attribute_map = { - "username": "username", # noqa: E501 - "groups": "groups", # noqa: E501 - "url": "url", # noqa: E501 - "id": "id", # noqa: E501 - "first_name": "first_name", # noqa: E501 - "last_name": "last_name", # noqa: E501 - "email": "email", # noqa: E501 - "is_staff": "is_staff", # noqa: E501 - "is_superuser": "is_superuser", # noqa: E501 - "is_active": "is_active", # noqa: E501 - "last_login": "last_login", # noqa: E501 - "date_joined": "date_joined", # noqa: E501 - } - - read_only_vars = { - "url", # noqa: E501 - "id", # noqa: E501 - "last_login", # noqa: E501 - "date_joined", # noqa: E501 - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, username, groups, *args, **kwargs): # noqa: E501 - """User - a model defined in OpenAPI - - Args: - username (str): Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - groups ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - email (str): [optional] # noqa: E501 - is_staff (bool): Designates whether the user can log into this admin site.. [optional] # noqa: E501 - is_superuser (bool): Designates that this user has all permissions without explicitly assigning them.. [optional] # noqa: E501 - is_active (bool): Designates whether this user should be treated as active. Unselect this instead of deleting accounts.. [optional] # noqa: E501 - last_login (datetime): [optional] # noqa: E501 - date_joined (datetime): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.username = username - self.groups = groups - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, username, groups, *args, **kwargs): # noqa: E501 - """User - a model defined in OpenAPI - - Args: - username (str): Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - groups ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - url (str): [optional] # noqa: E501 - id (int): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - email (str): [optional] # noqa: E501 - is_staff (bool): Designates whether the user can log into this admin site.. [optional] # noqa: E501 - is_superuser (bool): Designates that this user has all permissions without explicitly assigning them.. [optional] # noqa: E501 - is_active (bool): Designates whether this user should be treated as active. Unselect this instead of deleting accounts.. [optional] # noqa: E501 - last_login (datetime): [optional] # noqa: E501 - date_joined (datetime): [optional] # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.username = username - self.groups = groups - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/user_agreement.py b/cvat-sdk/cvat_sdk/model/user_agreement.py deleted file mode 100644 index 4f7ae482..00000000 --- a/cvat-sdk/cvat_sdk/model/user_agreement.py +++ /dev/null @@ -1,361 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class UserAgreement(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - name (str): - - display_text (str): [optional] if omitted the server will use the default value of "" # noqa: E501 - - url (str): [optional] if omitted the server will use the default value of "" # noqa: E501 - - required (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - - value (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("name",): { - "max_length": 256, - }, - ("display_text",): { - "max_length": 2048, - }, - ("url",): { - "max_length": 2048, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "name": (str,), # noqa: E501 - "display_text": (str,), # noqa: E501 - "url": (str,), # noqa: E501 - "required": (bool,), # noqa: E501 - "value": (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - name: str # noqa: E501 - """ - """ - - display_text: str # noqa: E501 - """ - [optional, default: ""] - """ - - url: str # noqa: E501 - """ - [optional, default: ""] - """ - - required: bool # noqa: E501 - """ - [optional, default: False] - """ - - value: bool # noqa: E501 - """ - [optional, default: False] - """ - - attribute_map = { - "name": "name", # noqa: E501 - "display_text": "display_text", # noqa: E501 - "url": "url", # noqa: E501 - "required": "required", # noqa: E501 - "value": "value", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 - """UserAgreement - a model defined in OpenAPI - - Args: - name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - display_text (str): [optional] if omitted the server will use the default value of "" # noqa: E501 - url (str): [optional] if omitted the server will use the default value of "" # noqa: E501 - required (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - value (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, name, *args, **kwargs): # noqa: E501 - """UserAgreement - a model defined in OpenAPI - - Args: - name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - display_text (str): [optional] if omitted the server will use the default value of "" # noqa: E501 - url (str): [optional] if omitted the server will use the default value of "" # noqa: E501 - required (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - value (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/model/user_agreement_request.py b/cvat-sdk/cvat_sdk/model/user_agreement_request.py deleted file mode 100644 index d472e08c..00000000 --- a/cvat-sdk/cvat_sdk/model/user_agreement_request.py +++ /dev/null @@ -1,364 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -from __future__ import annotations - -import re # noqa: F401 -import sys # noqa: F401 -import typing -from typing import TYPE_CHECKING - -from cvat_sdk.exceptions import ApiAttributeError -from cvat_sdk.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - OpenApiModel, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) - -if TYPE_CHECKING: - # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * - - -class UserAgreementRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - name (str): - - display_text (str): [optional] if omitted the server will use the default value of "" # noqa: E501 - - url (str): [optional] if omitted the server will use the default value of "" # noqa: E501 - - required (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - - value (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - - - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - - """ - - allowed_values = {} - - validations = { - ("name",): { - "max_length": 256, - "min_length": 1, - }, - ("display_text",): { - "max_length": 2048, - "min_length": 1, - }, - ("url",): { - "max_length": 2048, - "min_length": 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "name": (str,), # noqa: E501 - "display_text": (str,), # noqa: E501 - "url": (str,), # noqa: E501 - "required": (bool,), # noqa: E501 - "value": (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - # member type declarations - name: str # noqa: E501 - """ - """ - - display_text: str # noqa: E501 - """ - [optional, default: ""] - """ - - url: str # noqa: E501 - """ - [optional, default: ""] - """ - - required: bool # noqa: E501 - """ - [optional, default: False] - """ - - value: bool # noqa: E501 - """ - [optional, default: False] - """ - - attribute_map = { - "name": "name", # noqa: E501 - "display_text": "display_text", # noqa: E501 - "url": "url", # noqa: E501 - "required": "required", # noqa: E501 - "value": "value", # noqa: E501 - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 - """UserAgreementRequest - a model defined in OpenAPI - - Args: - name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - display_text (str): [optional] if omitted the server will use the default value of "" # noqa: E501 - url (str): [optional] if omitted the server will use the default value of "" # noqa: E501 - required (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - value (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set( - [ - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) - - @convert_js_args_to_python_args - def __init__(self, name, *args, **kwargs): # noqa: E501 - """UserAgreementRequest - a model defined in OpenAPI - - Args: - name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - display_text (str): [optional] if omitted the server will use the default value of "" # noqa: E501 - url (str): [optional] if omitted the server will use the default value of "" # noqa: E501 - required (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - value (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - """ - from cvat_sdk.configuration import Configuration - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", Configuration()) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/cvat-sdk/cvat_sdk/models.py b/cvat-sdk/cvat_sdk/models.py new file mode 100644 index 00000000..f768826a --- /dev/null +++ b/cvat-sdk/cvat_sdk/models.py @@ -0,0 +1,5 @@ +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +from cvat_sdk.api_client.models import * # pylint: disable=unused-import,redefined-builtin diff --git a/cvat-sdk/cvat_sdk/models/__init__.py b/cvat-sdk/cvat_sdk/models/__init__.py deleted file mode 100644 index a1f8ce52..00000000 --- a/cvat-sdk/cvat_sdk/models/__init__.py +++ /dev/null @@ -1,145 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from from cvat_sdk.model.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) - -from cvat_sdk.model.about import About -from cvat_sdk.model.annotation_file_request import AnnotationFileRequest -from cvat_sdk.model.attribute import Attribute -from cvat_sdk.model.attribute_request import AttributeRequest -from cvat_sdk.model.attribute_val import AttributeVal -from cvat_sdk.model.basic_user import BasicUser -from cvat_sdk.model.basic_user_request import BasicUserRequest -from cvat_sdk.model.chunk_type import ChunkType -from cvat_sdk.model.cloud_storage_read import CloudStorageRead -from cvat_sdk.model.cloud_storage_write import CloudStorageWrite -from cvat_sdk.model.cloud_storage_write_request import CloudStorageWriteRequest -from cvat_sdk.model.comment_read import CommentRead -from cvat_sdk.model.comment_read_owner import CommentReadOwner -from cvat_sdk.model.comment_write import CommentWrite -from cvat_sdk.model.comment_write_request import CommentWriteRequest -from cvat_sdk.model.credentials_type_enum import CredentialsTypeEnum -from cvat_sdk.model.data_meta_read import DataMetaRead -from cvat_sdk.model.data_request import DataRequest -from cvat_sdk.model.dataset_file_request import DatasetFileRequest -from cvat_sdk.model.dataset_format import DatasetFormat -from cvat_sdk.model.dataset_formats import DatasetFormats -from cvat_sdk.model.exception import Exception -from cvat_sdk.model.exception_request import ExceptionRequest -from cvat_sdk.model.file_info import FileInfo -from cvat_sdk.model.file_info_type_enum import FileInfoTypeEnum -from cvat_sdk.model.frame_meta import FrameMeta -from cvat_sdk.model.input_type_enum import InputTypeEnum -from cvat_sdk.model.invitation_read import InvitationRead -from cvat_sdk.model.invitation_write import InvitationWrite -from cvat_sdk.model.invitation_write_request import InvitationWriteRequest -from cvat_sdk.model.issue_read import IssueRead -from cvat_sdk.model.issue_write import IssueWrite -from cvat_sdk.model.issue_write_request import IssueWriteRequest -from cvat_sdk.model.job_commit import JobCommit -from cvat_sdk.model.job_read import JobRead -from cvat_sdk.model.job_stage import JobStage -from cvat_sdk.model.job_status import JobStatus -from cvat_sdk.model.job_write import JobWrite -from cvat_sdk.model.job_write_request import JobWriteRequest -from cvat_sdk.model.label import Label -from cvat_sdk.model.labeled_data import LabeledData -from cvat_sdk.model.labeled_image import LabeledImage -from cvat_sdk.model.labeled_shape import LabeledShape -from cvat_sdk.model.labeled_track import LabeledTrack -from cvat_sdk.model.location_enum import LocationEnum -from cvat_sdk.model.log_event import LogEvent -from cvat_sdk.model.log_event_request import LogEventRequest -from cvat_sdk.model.login_request import LoginRequest -from cvat_sdk.model.manifest import Manifest -from cvat_sdk.model.manifest_request import ManifestRequest -from cvat_sdk.model.membership_read import MembershipRead -from cvat_sdk.model.membership_write import MembershipWrite -from cvat_sdk.model.meta_user import MetaUser -from cvat_sdk.model.operation_status import OperationStatus -from cvat_sdk.model.organization_read import OrganizationRead -from cvat_sdk.model.organization_write import OrganizationWrite -from cvat_sdk.model.organization_write_request import OrganizationWriteRequest -from cvat_sdk.model.paginated_cloud_storage_read_list import PaginatedCloudStorageReadList -from cvat_sdk.model.paginated_comment_read_list import PaginatedCommentReadList -from cvat_sdk.model.paginated_invitation_read_list import PaginatedInvitationReadList -from cvat_sdk.model.paginated_issue_read_list import PaginatedIssueReadList -from cvat_sdk.model.paginated_job_commit_list import PaginatedJobCommitList -from cvat_sdk.model.paginated_job_read_list import PaginatedJobReadList -from cvat_sdk.model.paginated_membership_read_list import PaginatedMembershipReadList -from cvat_sdk.model.paginated_meta_user_list import PaginatedMetaUserList -from cvat_sdk.model.paginated_polymorphic_project_list import PaginatedPolymorphicProjectList -from cvat_sdk.model.paginated_task_read_list import PaginatedTaskReadList -from cvat_sdk.model.password_change_request import PasswordChangeRequest -from cvat_sdk.model.password_reset_confirm_request import PasswordResetConfirmRequest -from cvat_sdk.model.password_reset_serializer_ex_request import PasswordResetSerializerExRequest -from cvat_sdk.model.patched_cloud_storage_write_request import PatchedCloudStorageWriteRequest -from cvat_sdk.model.patched_comment_write_request import PatchedCommentWriteRequest -from cvat_sdk.model.patched_invitation_write_request import PatchedInvitationWriteRequest -from cvat_sdk.model.patched_issue_write_request import PatchedIssueWriteRequest -from cvat_sdk.model.patched_job_write_request import PatchedJobWriteRequest -from cvat_sdk.model.patched_label_request import PatchedLabelRequest -from cvat_sdk.model.patched_membership_write_request import PatchedMembershipWriteRequest -from cvat_sdk.model.patched_organization_write_request import PatchedOrganizationWriteRequest -from cvat_sdk.model.patched_project_write_request import PatchedProjectWriteRequest -from cvat_sdk.model.patched_project_write_request_target_storage import ( - PatchedProjectWriteRequestTargetStorage, -) -from cvat_sdk.model.patched_task_write_request import PatchedTaskWriteRequest -from cvat_sdk.model.patched_task_write_request_target_storage import ( - PatchedTaskWriteRequestTargetStorage, -) -from cvat_sdk.model.patched_user_request import PatchedUserRequest -from cvat_sdk.model.plugins import Plugins -from cvat_sdk.model.polymorphic_project import PolymorphicProject -from cvat_sdk.model.project_file_request import ProjectFileRequest -from cvat_sdk.model.project_read import ProjectRead -from cvat_sdk.model.project_read_assignee import ProjectReadAssignee -from cvat_sdk.model.project_read_owner import ProjectReadOwner -from cvat_sdk.model.project_read_target_storage import ProjectReadTargetStorage -from cvat_sdk.model.project_search import ProjectSearch -from cvat_sdk.model.project_write import ProjectWrite -from cvat_sdk.model.project_write_request import ProjectWriteRequest -from cvat_sdk.model.provider_type_enum import ProviderTypeEnum -from cvat_sdk.model.rest_auth_detail import RestAuthDetail -from cvat_sdk.model.restricted_register import RestrictedRegister -from cvat_sdk.model.restricted_register_request import RestrictedRegisterRequest -from cvat_sdk.model.role_enum import RoleEnum -from cvat_sdk.model.rq_status import RqStatus -from cvat_sdk.model.rq_status_state_enum import RqStatusStateEnum -from cvat_sdk.model.segment import Segment -from cvat_sdk.model.shape_type import ShapeType -from cvat_sdk.model.signing_request import SigningRequest -from cvat_sdk.model.simple_job import SimpleJob -from cvat_sdk.model.sorting_method import SortingMethod -from cvat_sdk.model.storage import Storage -from cvat_sdk.model.storage_method import StorageMethod -from cvat_sdk.model.storage_request import StorageRequest -from cvat_sdk.model.storage_type import StorageType -from cvat_sdk.model.task_file_request import TaskFileRequest -from cvat_sdk.model.task_read import TaskRead -from cvat_sdk.model.task_read_target_storage import TaskReadTargetStorage -from cvat_sdk.model.task_write import TaskWrite -from cvat_sdk.model.task_write_request import TaskWriteRequest -from cvat_sdk.model.token import Token -from cvat_sdk.model.tracked_shape import TrackedShape -from cvat_sdk.model.user import User -from cvat_sdk.model.user_agreement import UserAgreement -from cvat_sdk.model.user_agreement_request import UserAgreementRequest diff --git a/cvat-sdk/cvat_sdk/rest.py b/cvat-sdk/cvat_sdk/rest.py deleted file mode 100644 index cb9ea5a8..00000000 --- a/cvat-sdk/cvat_sdk/rest.py +++ /dev/null @@ -1,446 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -import io -import ipaddress -import json -import logging -import re -import ssl -from urllib.parse import urlencode, urlparse -from urllib.request import proxy_bypass_environment - -import urllib3 - -from cvat_sdk.exceptions import ( - ApiException, - ApiValueError, - ForbiddenException, - NotFoundException, - ServiceException, - UnauthorizedException, -) - -logger = logging.getLogger(__name__) - - -class RESTClientObject(object): - def __init__(self, configuration, pools_size=4, maxsize=None): - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - addition_pool_args = {} - if configuration.assert_hostname is not None: - addition_pool_args["assert_hostname"] = configuration.assert_hostname # noqa: E501 - - if configuration.retries is not None: - addition_pool_args["retries"] = configuration.retries - - if configuration.socket_options is not None: - addition_pool_args["socket_options"] = configuration.socket_options - - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 - - # https pool manager - if configuration.proxy and not should_bypass_proxies( - configuration.host, no_proxy=configuration.no_proxy or "" - ): - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args, - ) - else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args, - ) - - def request( - self, - method, - url, - query_params=None, - headers=None, - files=None, - body=None, - post_params=None, - *, - _parse_response=True, - _request_timeout=None, - _check_status=True, - ) -> urllib3.HTTPResponse: - """Perform requests. - - :param method: http request method - :param url: http request url - :param query_params: query parameters in the url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: plain parameters for POST/PUT/PATCH requests, - when 'Content-Type' is - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param files: file parameters for POST/PUT/PATCH requests - :param _parse_response: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"] - - if post_params and body: - raise ApiValueError("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)): # noqa: E501,F821 - timeout = urllib3.Timeout(total=_request_timeout) - elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2: - timeout = urllib3.Timeout(connect=_request_timeout[0], read=_request_timeout[1]) - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: - # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests - if (method != "DELETE") and ("Content-Type" not in headers): - headers["Content-Type"] = "application/json" - if query_params: - url += "?" + urlencode(query_params) - if ("Content-Type" not in headers) or ( - re.search("json", headers["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, - preload_content=_parse_response, - timeout=timeout, - headers=headers, - ) - elif headers["Content-Type"] == "application/x-www-form-urlencoded": # noqa: E501 - if files: - raise ApiException( - "Files cannot be used when Content-Type " - "is 'application/x-www-form-urlencoded'" - ) - r = self.pool_manager.request( - method, - url, - fields=post_params, - encode_multipart=False, - preload_content=_parse_response, - timeout=timeout, - headers=headers, - ) - elif headers["Content-Type"] == "multipart/form-data": - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers["Content-Type"] - r = self.pool_manager.request( - method, - url, - fields=post_params, - encode_multipart=True, - preload_content=_parse_response, - timeout=timeout, - headers=headers, - ) - # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form - elif isinstance(body, str) or isinstance(body, bytes) or files: - request_body = body - r = self.pool_manager.request( - method, - url, - body=request_body, - preload_content=_parse_response, - timeout=timeout, - headers=headers, - ) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request( - method, - url, - fields=query_params, - preload_content=_parse_response, - timeout=timeout, - headers=headers, - ) - except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) - raise ApiException(status=0, reason=msg) - - if _check_status and not 200 <= r.status <= 299: - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def GET( - self, - url, - headers=None, - query_params=None, - _parse_response=True, - _request_timeout=None, - _check_status=True, - ): - return self.request( - "GET", - url, - headers=headers, - _parse_response=_parse_response, - _request_timeout=_request_timeout, - _check_status=_check_status, - query_params=query_params, - ) - - def HEAD( - self, - url, - headers=None, - query_params=None, - _parse_response=True, - _request_timeout=None, - _check_status=True, - ): - return self.request( - "HEAD", - url, - headers=headers, - _parse_response=_parse_response, - _request_timeout=_request_timeout, - query_params=query_params, - _check_status=_check_status, - ) - - def OPTIONS( - self, - url, - headers=None, - query_params=None, - post_params=None, - body=None, - _parse_response=True, - _request_timeout=None, - _check_status=True, - ): - return self.request( - "OPTIONS", - url, - headers=headers, - query_params=query_params, - post_params=post_params, - _parse_response=_parse_response, - _request_timeout=_request_timeout, - _check_status=_check_status, - body=body, - ) - - def DELETE( - self, - url, - headers=None, - query_params=None, - body=None, - _parse_response=True, - _request_timeout=None, - _check_status=True, - ): - return self.request( - "DELETE", - url, - headers=headers, - query_params=query_params, - _parse_response=_parse_response, - _request_timeout=_request_timeout, - _check_status=_check_status, - body=body, - ) - - def POST( - self, - url, - headers=None, - query_params=None, - post_params=None, - body=None, - _parse_response=True, - _request_timeout=None, - _check_status=True, - ): - return self.request( - "POST", - url, - headers=headers, - query_params=query_params, - post_params=post_params, - _parse_response=_parse_response, - _request_timeout=_request_timeout, - _check_status=_check_status, - body=body, - ) - - def PUT( - self, - url, - headers=None, - query_params=None, - post_params=None, - body=None, - _parse_response=True, - _request_timeout=None, - _check_status=True, - ): - return self.request( - "PUT", - url, - headers=headers, - query_params=query_params, - post_params=post_params, - _parse_response=_parse_response, - _request_timeout=_request_timeout, - _check_status=_check_status, - body=body, - ) - - def PATCH( - self, - url, - headers=None, - query_params=None, - post_params=None, - body=None, - _parse_response=True, - _request_timeout=None, - _check_status=True, - ): - return self.request( - "PATCH", - url, - headers=headers, - query_params=query_params, - post_params=post_params, - _parse_response=_parse_response, - _request_timeout=_request_timeout, - _check_status=_check_status, - body=body, - ) - - -# end of class RESTClientObject - - -def is_ipv4(target): - """Test if IPv4 address or not""" - try: - chk = ipaddress.IPv4Address(target) - return True - except ipaddress.AddressValueError: - return False - - -def in_ipv4net(target, net): - """Test if target belongs to given IPv4 network""" - try: - nw = ipaddress.IPv4Network(net) - ip = ipaddress.IPv4Address(target) - if ip in nw: - return True - return False - except ipaddress.AddressValueError: - return False - except ipaddress.NetmaskValueError: - return False - - -def should_bypass_proxies(url, no_proxy=None): - """Yet another requests.should_bypass_proxies - Test if proxies should not be used for a particular url. - """ - - parsed = urlparse(url) - - # special cases - if parsed.hostname in [None, ""]: - return True - - # special cases - if no_proxy in [None, ""]: - return False - if no_proxy == "*": - return True - - no_proxy = no_proxy.lower().replace(" ", "") - entries = (host for host in no_proxy.split(",") if host) - - if is_ipv4(parsed.hostname): - for item in entries: - if in_ipv4net(parsed.hostname, item): - return True - return proxy_bypass_environment(parsed.hostname, {"no": no_proxy}) diff --git a/cvat-sdk/developer_guide.md b/cvat-sdk/developer_guide.md index e55965a9..9cbee779 100644 --- a/cvat-sdk/developer_guide.md +++ b/cvat-sdk/developer_guide.md @@ -14,7 +14,7 @@ python manage.py spectacular --file schema.yml && mkdir -p cvat-sdk/schema/ && m 2. Generate package code (call from the package root directory): ```bash -# pip install -r requirements/development.txt +# pip install -r gen/requirements.txt ./gen/generate.sh ``` @@ -38,5 +38,11 @@ Relevant links: ## How to test -API client tests are integrated into REST API tests (`/tests/rest_api/`). +API client tests are integrated into REST API tests (`/tests/python/rest_api`) +and SDK tests are placed next to them (`/tests/python/sdk`). +To execute, run: +```bash +pytest tests/python/rest_api tests/python/sdk +``` + To allow editing of the package, install it with `pip install -e cvat-sdk/`. diff --git a/cvat-sdk/docs/About.md b/cvat-sdk/docs/About.md deleted file mode 100644 index e8041640..00000000 --- a/cvat-sdk/docs/About.md +++ /dev/null @@ -1,14 +0,0 @@ -# About - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | -**description** | **str** | | -**version** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/AnnotationFileRequest.md b/cvat-sdk/docs/AnnotationFileRequest.md deleted file mode 100644 index 189fd54d..00000000 --- a/cvat-sdk/docs/AnnotationFileRequest.md +++ /dev/null @@ -1,12 +0,0 @@ -# AnnotationFileRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**annotation_file** | **file_type** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/Attribute.md b/cvat-sdk/docs/Attribute.md deleted file mode 100644 index 00dfdbcd..00000000 --- a/cvat-sdk/docs/Attribute.md +++ /dev/null @@ -1,17 +0,0 @@ -# Attribute - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | -**mutable** | **bool** | | -**input_type** | [**InputTypeEnum**](InputTypeEnum.md) | | -**default_value** | **str** | | -**values** | **[str]** | | -**id** | **int** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/AttributeRequest.md b/cvat-sdk/docs/AttributeRequest.md deleted file mode 100644 index 22c46f32..00000000 --- a/cvat-sdk/docs/AttributeRequest.md +++ /dev/null @@ -1,16 +0,0 @@ -# AttributeRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | -**mutable** | **bool** | | -**input_type** | [**InputTypeEnum**](InputTypeEnum.md) | | -**default_value** | **str** | | -**values** | **[str]** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/AttributeVal.md b/cvat-sdk/docs/AttributeVal.md deleted file mode 100644 index c9e7dc43..00000000 --- a/cvat-sdk/docs/AttributeVal.md +++ /dev/null @@ -1,13 +0,0 @@ -# AttributeVal - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**spec_id** | **int** | | -**value** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/AuthApi.md b/cvat-sdk/docs/AuthApi.md deleted file mode 100644 index fefd0ace..00000000 --- a/cvat-sdk/docs/AuthApi.md +++ /dev/null @@ -1,828 +0,0 @@ -# cvat_sdk.AuthApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**auth_create_login**](AuthApi.md#auth_create_login) | **POST** /api/auth/login | -[**auth_create_logout**](AuthApi.md#auth_create_logout) | **POST** /api/auth/logout | -[**auth_create_password_change**](AuthApi.md#auth_create_password_change) | **POST** /api/auth/password/change | -[**auth_create_password_reset**](AuthApi.md#auth_create_password_reset) | **POST** /api/auth/password/reset | -[**auth_create_password_reset_confirm**](AuthApi.md#auth_create_password_reset_confirm) | **POST** /api/auth/password/reset/confirm | -[**auth_create_register**](AuthApi.md#auth_create_register) | **POST** /api/auth/register | -[**auth_create_signing**](AuthApi.md#auth_create_signing) | **POST** /api/auth/signing | This method signs URL for access to the server - - -# **auth_create_login** -> Token auth_create_login(login_request) - - - -Check the credentials and return the REST Token if the credentials are valid and authenticated. Calls Django Auth login method to register User ID in Django session framework Accept the following POST parameters: username, password Return the REST Framework Token Object's key. - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import auth_api -from cvat_sdk.model.token import Token -from cvat_sdk.model.login_request import LoginRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = auth_api.AuthApi(api_client) - login_request = LoginRequest( - username="username_example", - email="email_example", - password="password_example", - ) # LoginRequest | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - api_response = api_instance.auth_create_login(login_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling AuthApi->auth_create_login: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.auth_create_login(login_request, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling AuthApi->auth_create_login: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **login_request** | [**LoginRequest**](LoginRequest.md)| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**Token**](Token.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **auth_create_logout** -> RestAuthDetail auth_create_logout() - - - -Calls Django logout method and delete the Token object assigned to the current User object. Accepts/Returns nothing. - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import auth_api -from cvat_sdk.model.rest_auth_detail import RestAuthDetail -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = auth_api.AuthApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.auth_create_logout(x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling AuthApi->auth_create_logout: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**RestAuthDetail**](RestAuthDetail.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **auth_create_password_change** -> RestAuthDetail auth_create_password_change(password_change_request) - - - -Calls Django Auth SetPasswordForm save method. Accepts the following POST parameters: new_password1, new_password2 Returns the success/fail message. - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import auth_api -from cvat_sdk.model.password_change_request import PasswordChangeRequest -from cvat_sdk.model.rest_auth_detail import RestAuthDetail -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = auth_api.AuthApi(api_client) - password_change_request = PasswordChangeRequest( - old_password="old_password_example", - new_password1="new_password1_example", - new_password2="new_password2_example", - ) # PasswordChangeRequest | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - api_response = api_instance.auth_create_password_change(password_change_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling AuthApi->auth_create_password_change: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.auth_create_password_change(password_change_request, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling AuthApi->auth_create_password_change: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **password_change_request** | [**PasswordChangeRequest**](PasswordChangeRequest.md)| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**RestAuthDetail**](RestAuthDetail.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **auth_create_password_reset** -> RestAuthDetail auth_create_password_reset(password_reset_serializer_ex_request) - - - -Calls Django Auth PasswordResetForm save method. Accepts the following POST parameters: email Returns the success/fail message. - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import auth_api -from cvat_sdk.model.password_reset_serializer_ex_request import PasswordResetSerializerExRequest -from cvat_sdk.model.rest_auth_detail import RestAuthDetail -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = auth_api.AuthApi(api_client) - password_reset_serializer_ex_request = PasswordResetSerializerExRequest( - email="email_example", - ) # PasswordResetSerializerExRequest | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - api_response = api_instance.auth_create_password_reset(password_reset_serializer_ex_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling AuthApi->auth_create_password_reset: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.auth_create_password_reset(password_reset_serializer_ex_request, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling AuthApi->auth_create_password_reset: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **password_reset_serializer_ex_request** | [**PasswordResetSerializerExRequest**](PasswordResetSerializerExRequest.md)| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**RestAuthDetail**](RestAuthDetail.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **auth_create_password_reset_confirm** -> RestAuthDetail auth_create_password_reset_confirm(password_reset_confirm_request) - - - -Password reset e-mail link is confirmed, therefore this resets the user's password. Accepts the following POST parameters: token, uid, new_password1, new_password2 Returns the success/fail message. - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import auth_api -from cvat_sdk.model.password_reset_confirm_request import PasswordResetConfirmRequest -from cvat_sdk.model.rest_auth_detail import RestAuthDetail -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = auth_api.AuthApi(api_client) - password_reset_confirm_request = PasswordResetConfirmRequest( - new_password1="new_password1_example", - new_password2="new_password2_example", - uid="uid_example", - token="token_example", - ) # PasswordResetConfirmRequest | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - api_response = api_instance.auth_create_password_reset_confirm(password_reset_confirm_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling AuthApi->auth_create_password_reset_confirm: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.auth_create_password_reset_confirm(password_reset_confirm_request, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling AuthApi->auth_create_password_reset_confirm: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **password_reset_confirm_request** | [**PasswordResetConfirmRequest**](PasswordResetConfirmRequest.md)| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**RestAuthDetail**](RestAuthDetail.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **auth_create_register** -> RestrictedRegister auth_create_register(restricted_register_request) - - - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import auth_api -from cvat_sdk.model.restricted_register_request import RestrictedRegisterRequest -from cvat_sdk.model.restricted_register import RestrictedRegister -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = auth_api.AuthApi(api_client) - restricted_register_request = RestrictedRegisterRequest( - username="username_example", - email="email_example", - password1="password1_example", - password2="password2_example", - first_name="first_name_example", - last_name="last_name_example", - confirmations=[ - UserAgreementRequest( - name="name_example", - display_text="", - url="", - required=False, - value=False, - ), - ], - ) # RestrictedRegisterRequest | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - api_response = api_instance.auth_create_register(restricted_register_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling AuthApi->auth_create_register: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.auth_create_register(restricted_register_request, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling AuthApi->auth_create_register: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **restricted_register_request** | [**RestrictedRegisterRequest**](RestrictedRegisterRequest.md)| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**RestrictedRegister**](RestrictedRegister.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **auth_create_signing** -> str auth_create_signing(signing_request) - -This method signs URL for access to the server - -Signed URL contains a token which authenticates a user on the server.Signed URL is valid during 30 seconds since signing. - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import auth_api -from cvat_sdk.model.signing_request import SigningRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = auth_api.AuthApi(api_client) - signing_request = SigningRequest( - url="url_example", - ) # SigningRequest | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # This method signs URL for access to the server - api_response = api_instance.auth_create_signing(signing_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling AuthApi->auth_create_signing: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # This method signs URL for access to the server - api_response = api_instance.auth_create_signing(signing_request, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling AuthApi->auth_create_signing: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **signing_request** | [**SigningRequest**](SigningRequest.md)| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -**str** - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | text URL | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/cvat-sdk/docs/BasicUser.md b/cvat-sdk/docs/BasicUser.md deleted file mode 100644 index 2ea41bd1..00000000 --- a/cvat-sdk/docs/BasicUser.md +++ /dev/null @@ -1,16 +0,0 @@ -# BasicUser - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | **str** | Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. | -**url** | **str** | | [optional] [readonly] -**id** | **int** | | [optional] [readonly] -**first_name** | **str** | | [optional] -**last_name** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/BasicUserRequest.md b/cvat-sdk/docs/BasicUserRequest.md deleted file mode 100644 index 46168ca9..00000000 --- a/cvat-sdk/docs/BasicUserRequest.md +++ /dev/null @@ -1,14 +0,0 @@ -# BasicUserRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | **str** | Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. | -**first_name** | **str** | | [optional] -**last_name** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/ChunkType.md b/cvat-sdk/docs/ChunkType.md deleted file mode 100644 index 8894838c..00000000 --- a/cvat-sdk/docs/ChunkType.md +++ /dev/null @@ -1,11 +0,0 @@ -# ChunkType - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["video", "imageset", "list", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/CloudStorageRead.md b/cvat-sdk/docs/CloudStorageRead.md deleted file mode 100644 index caaff4c8..00000000 --- a/cvat-sdk/docs/CloudStorageRead.md +++ /dev/null @@ -1,23 +0,0 @@ -# CloudStorageRead - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**provider_type** | [**ProviderTypeEnum**](ProviderTypeEnum.md) | | -**resource** | **str** | | -**display_name** | **str** | | -**credentials_type** | [**CredentialsTypeEnum**](CredentialsTypeEnum.md) | | -**id** | **int** | | [optional] [readonly] -**owner** | [**BasicUser**](BasicUser.md) | | [optional] -**manifests** | [**[Manifest]**](Manifest.md) | | [optional] if omitted the server will use the default value of [] -**created_date** | **datetime** | | [optional] [readonly] -**updated_date** | **datetime** | | [optional] [readonly] -**specific_attributes** | **str** | | [optional] -**description** | **str** | | [optional] -**organization** | **int, none_type** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/CloudStorageWrite.md b/cvat-sdk/docs/CloudStorageWrite.md deleted file mode 100644 index ac44b1ec..00000000 --- a/cvat-sdk/docs/CloudStorageWrite.md +++ /dev/null @@ -1,28 +0,0 @@ -# CloudStorageWrite - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**provider_type** | [**ProviderTypeEnum**](ProviderTypeEnum.md) | | -**resource** | **str** | | -**display_name** | **str** | | -**credentials_type** | [**CredentialsTypeEnum**](CredentialsTypeEnum.md) | | -**owner** | [**BasicUser**](BasicUser.md) | | [optional] -**created_date** | **datetime** | | [optional] [readonly] -**updated_date** | **datetime** | | [optional] [readonly] -**session_token** | **str** | | [optional] -**account_name** | **str** | | [optional] -**key** | **str** | | [optional] -**secret_key** | **str** | | [optional] -**key_file** | **str** | | [optional] -**specific_attributes** | **str** | | [optional] -**description** | **str** | | [optional] -**id** | **int** | | [optional] [readonly] -**manifests** | [**[Manifest]**](Manifest.md) | | [optional] if omitted the server will use the default value of [] -**organization** | **int, none_type** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/CloudStorageWriteRequest.md b/cvat-sdk/docs/CloudStorageWriteRequest.md deleted file mode 100644 index e15839ba..00000000 --- a/cvat-sdk/docs/CloudStorageWriteRequest.md +++ /dev/null @@ -1,24 +0,0 @@ -# CloudStorageWriteRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**provider_type** | [**ProviderTypeEnum**](ProviderTypeEnum.md) | | -**resource** | **str** | | -**display_name** | **str** | | -**credentials_type** | [**CredentialsTypeEnum**](CredentialsTypeEnum.md) | | -**owner** | [**BasicUserRequest**](BasicUserRequest.md) | | [optional] -**session_token** | **str** | | [optional] -**account_name** | **str** | | [optional] -**key** | **str** | | [optional] -**secret_key** | **str** | | [optional] -**key_file** | **file_type** | | [optional] -**specific_attributes** | **str** | | [optional] -**description** | **str** | | [optional] -**manifests** | [**[ManifestRequest]**](ManifestRequest.md) | | [optional] if omitted the server will use the default value of [] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/CloudStoragesApi.md b/cvat-sdk/docs/CloudStoragesApi.md deleted file mode 100644 index cf5f3caa..00000000 --- a/cvat-sdk/docs/CloudStoragesApi.md +++ /dev/null @@ -1,1068 +0,0 @@ -# cvat_sdk.CloudStoragesApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**cloudstorages_create**](CloudStoragesApi.md#cloudstorages_create) | **POST** /api/cloudstorages | Method creates a cloud storage with a specified characteristics -[**cloudstorages_destroy**](CloudStoragesApi.md#cloudstorages_destroy) | **DELETE** /api/cloudstorages/{id} | Method deletes a specific cloud storage -[**cloudstorages_list**](CloudStoragesApi.md#cloudstorages_list) | **GET** /api/cloudstorages | Returns a paginated list of storages according to query parameters -[**cloudstorages_partial_update**](CloudStoragesApi.md#cloudstorages_partial_update) | **PATCH** /api/cloudstorages/{id} | Methods does a partial update of chosen fields in a cloud storage instance -[**cloudstorages_retrieve**](CloudStoragesApi.md#cloudstorages_retrieve) | **GET** /api/cloudstorages/{id} | Method returns details of a specific cloud storage -[**cloudstorages_retrieve_actions**](CloudStoragesApi.md#cloudstorages_retrieve_actions) | **GET** /api/cloudstorages/{id}/actions | Method returns allowed actions for the cloud storage -[**cloudstorages_retrieve_content**](CloudStoragesApi.md#cloudstorages_retrieve_content) | **GET** /api/cloudstorages/{id}/content | Method returns a manifest content -[**cloudstorages_retrieve_preview**](CloudStoragesApi.md#cloudstorages_retrieve_preview) | **GET** /api/cloudstorages/{id}/preview | Method returns a preview image from a cloud storage -[**cloudstorages_retrieve_status**](CloudStoragesApi.md#cloudstorages_retrieve_status) | **GET** /api/cloudstorages/{id}/status | Method returns a cloud storage status - - -# **cloudstorages_create** -> CloudStorageWrite cloudstorages_create(cloud_storage_write_request) - -Method creates a cloud storage with a specified characteristics - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import cloud_storages_api -from cvat_sdk.model.cloud_storage_write import CloudStorageWrite -from cvat_sdk.model.cloud_storage_write_request import CloudStorageWriteRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = cloud_storages_api.CloudStoragesApi(api_client) - cloud_storage_write_request = CloudStorageWriteRequest( - provider_type=ProviderTypeEnum("AWS_S3_BUCKET"), - resource="resource_example", - display_name="display_name_example", - owner=BasicUserRequest( - username="A", - first_name="first_name_example", - last_name="last_name_example", - ), - credentials_type=CredentialsTypeEnum("KEY_SECRET_KEY_PAIR"), - session_token="session_token_example", - account_name="account_name_example", - key="key_example", - secret_key="secret_key_example", - key_file=open('/path/to/file', 'rb'), - specific_attributes="specific_attributes_example", - description="description_example", - manifests=[ - ManifestRequest( - filename="filename_example", - ), - ], - ) # CloudStorageWriteRequest | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method creates a cloud storage with a specified characteristics - api_response = api_instance.cloudstorages_create(cloud_storage_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling CloudStoragesApi->cloudstorages_create: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method creates a cloud storage with a specified characteristics - api_response = api_instance.cloudstorages_create(cloud_storage_write_request, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling CloudStoragesApi->cloudstorages_create: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **cloud_storage_write_request** | [**CloudStorageWriteRequest**](CloudStorageWriteRequest.md)| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**CloudStorageWrite**](CloudStorageWrite.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **cloudstorages_destroy** -> cloudstorages_destroy(id) - -Method deletes a specific cloud storage - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import cloud_storages_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = cloud_storages_api.CloudStoragesApi(api_client) - id = 1 # int | A unique integer value identifying this cloud storage. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method deletes a specific cloud storage - api_instance.cloudstorages_destroy(id) - except cvat_sdk.ApiException as e: - print("Exception when calling CloudStoragesApi->cloudstorages_destroy: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method deletes a specific cloud storage - api_instance.cloudstorages_destroy(id, x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling CloudStoragesApi->cloudstorages_destroy: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this cloud storage. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | The cloud storage has been removed | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **cloudstorages_list** -> PaginatedCloudStorageReadList cloudstorages_list() - -Returns a paginated list of storages according to query parameters - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import cloud_storages_api -from cvat_sdk.model.paginated_cloud_storage_read_list import PaginatedCloudStorageReadList -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = cloud_storages_api.CloudStoragesApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - filter = "filter_example" # str | A filter term. Avaliable filter_fields: ['provider_type', 'display_name', 'resource', 'credentials_type', 'owner', 'description', 'id'] (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - page = 1 # int | A page number within the paginated result set. (optional) - page_size = 1 # int | Number of results to return per page. (optional) - search = "search_example" # str | A search term. Avaliable search_fields: ('provider_type', 'display_name', 'resource', 'credentials_type', 'owner', 'description') (optional) - sort = "sort_example" # str | Which field to use when ordering the results. Avaliable ordering_fields: ['provider_type', 'display_name', 'resource', 'credentials_type', 'owner', 'description', 'id'] (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Returns a paginated list of storages according to query parameters - api_response = api_instance.cloudstorages_list(x_organization=x_organization, filter=filter, org=org, org_id=org_id, page=page, page_size=page_size, search=search, sort=sort) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling CloudStoragesApi->cloudstorages_list: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **filter** | **str**| A filter term. Avaliable filter_fields: ['provider_type', 'display_name', 'resource', 'credentials_type', 'owner', 'description', 'id'] | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **page** | **int**| A page number within the paginated result set. | [optional] - **page_size** | **int**| Number of results to return per page. | [optional] - **search** | **str**| A search term. Avaliable search_fields: ('provider_type', 'display_name', 'resource', 'credentials_type', 'owner', 'description') | [optional] - **sort** | **str**| Which field to use when ordering the results. Avaliable ordering_fields: ['provider_type', 'display_name', 'resource', 'credentials_type', 'owner', 'description', 'id'] | [optional] - -### Return type - -[**PaginatedCloudStorageReadList**](PaginatedCloudStorageReadList.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **cloudstorages_partial_update** -> CloudStorageWrite cloudstorages_partial_update(id) - -Methods does a partial update of chosen fields in a cloud storage instance - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import cloud_storages_api -from cvat_sdk.model.patched_cloud_storage_write_request import PatchedCloudStorageWriteRequest -from cvat_sdk.model.cloud_storage_write import CloudStorageWrite -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = cloud_storages_api.CloudStoragesApi(api_client) - id = 1 # int | A unique integer value identifying this cloud storage. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - patched_cloud_storage_write_request = PatchedCloudStorageWriteRequest( - provider_type=ProviderTypeEnum("AWS_S3_BUCKET"), - resource="resource_example", - display_name="display_name_example", - owner=BasicUserRequest( - username="A", - first_name="first_name_example", - last_name="last_name_example", - ), - credentials_type=CredentialsTypeEnum("KEY_SECRET_KEY_PAIR"), - session_token="session_token_example", - account_name="account_name_example", - key="key_example", - secret_key="secret_key_example", - key_file=open('/path/to/file', 'rb'), - specific_attributes="specific_attributes_example", - description="description_example", - manifests=[ - ManifestRequest( - filename="filename_example", - ), - ], - ) # PatchedCloudStorageWriteRequest | (optional) - - # example passing only required values which don't have defaults set - try: - # Methods does a partial update of chosen fields in a cloud storage instance - api_response = api_instance.cloudstorages_partial_update(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling CloudStoragesApi->cloudstorages_partial_update: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Methods does a partial update of chosen fields in a cloud storage instance - api_response = api_instance.cloudstorages_partial_update(id, x_organization=x_organization, org=org, org_id=org_id, patched_cloud_storage_write_request=patched_cloud_storage_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling CloudStoragesApi->cloudstorages_partial_update: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this cloud storage. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **patched_cloud_storage_write_request** | [**PatchedCloudStorageWriteRequest**](PatchedCloudStorageWriteRequest.md)| | [optional] - -### Return type - -[**CloudStorageWrite**](CloudStorageWrite.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **cloudstorages_retrieve** -> CloudStorageRead cloudstorages_retrieve(id) - -Method returns details of a specific cloud storage - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import cloud_storages_api -from cvat_sdk.model.cloud_storage_read import CloudStorageRead -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = cloud_storages_api.CloudStoragesApi(api_client) - id = 1 # int | A unique integer value identifying this cloud storage. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method returns details of a specific cloud storage - api_response = api_instance.cloudstorages_retrieve(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling CloudStoragesApi->cloudstorages_retrieve: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns details of a specific cloud storage - api_response = api_instance.cloudstorages_retrieve(id, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling CloudStoragesApi->cloudstorages_retrieve: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this cloud storage. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**CloudStorageRead**](CloudStorageRead.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **cloudstorages_retrieve_actions** -> str cloudstorages_retrieve_actions(id) - -Method returns allowed actions for the cloud storage - -Method return allowed actions for cloud storage. It's required for reading/writing - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import cloud_storages_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = cloud_storages_api.CloudStoragesApi(api_client) - id = 1 # int | A unique integer value identifying this cloud storage. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method returns allowed actions for the cloud storage - api_response = api_instance.cloudstorages_retrieve_actions(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling CloudStoragesApi->cloudstorages_retrieve_actions: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns allowed actions for the cloud storage - api_response = api_instance.cloudstorages_retrieve_actions(id, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling CloudStoragesApi->cloudstorages_retrieve_actions: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this cloud storage. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -**str** - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Cloud Storage actions (GET | PUT | DELETE) | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **cloudstorages_retrieve_content** -> [str] cloudstorages_retrieve_content(id) - -Method returns a manifest content - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import cloud_storages_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = cloud_storages_api.CloudStoragesApi(api_client) - id = 1 # int | A unique integer value identifying this cloud storage. - x_organization = "X-Organization_example" # str | (optional) - manifest_path = "manifest_path_example" # str | Path to the manifest file in a cloud storage (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method returns a manifest content - api_response = api_instance.cloudstorages_retrieve_content(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling CloudStoragesApi->cloudstorages_retrieve_content: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns a manifest content - api_response = api_instance.cloudstorages_retrieve_content(id, x_organization=x_organization, manifest_path=manifest_path, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling CloudStoragesApi->cloudstorages_retrieve_content: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this cloud storage. | - **x_organization** | **str**| | [optional] - **manifest_path** | **str**| Path to the manifest file in a cloud storage | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -**[str]** - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | A manifest content | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **cloudstorages_retrieve_preview** -> cloudstorages_retrieve_preview(id) - -Method returns a preview image from a cloud storage - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import cloud_storages_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = cloud_storages_api.CloudStoragesApi(api_client) - id = 1 # int | A unique integer value identifying this cloud storage. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method returns a preview image from a cloud storage - api_instance.cloudstorages_retrieve_preview(id) - except cvat_sdk.ApiException as e: - print("Exception when calling CloudStoragesApi->cloudstorages_retrieve_preview: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns a preview image from a cloud storage - api_instance.cloudstorages_retrieve_preview(id, x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling CloudStoragesApi->cloudstorages_retrieve_preview: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this cloud storage. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Cloud Storage preview | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **cloudstorages_retrieve_status** -> str cloudstorages_retrieve_status(id) - -Method returns a cloud storage status - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import cloud_storages_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = cloud_storages_api.CloudStoragesApi(api_client) - id = 1 # int | A unique integer value identifying this cloud storage. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method returns a cloud storage status - api_response = api_instance.cloudstorages_retrieve_status(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling CloudStoragesApi->cloudstorages_retrieve_status: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns a cloud storage status - api_response = api_instance.cloudstorages_retrieve_status(id, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling CloudStoragesApi->cloudstorages_retrieve_status: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this cloud storage. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -**str** - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Cloud Storage status (AVAILABLE | NOT_FOUND | FORBIDDEN) | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/cvat-sdk/docs/CommentRead.md b/cvat-sdk/docs/CommentRead.md deleted file mode 100644 index b1ab4284..00000000 --- a/cvat-sdk/docs/CommentRead.md +++ /dev/null @@ -1,17 +0,0 @@ -# CommentRead - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [readonly] -**issue** | **int** | | [optional] [readonly] -**owner** | [**CommentReadOwner**](CommentReadOwner.md) | | [optional] -**message** | **str** | | [optional] [readonly] -**created_date** | **datetime** | | [optional] [readonly] -**updated_date** | **datetime** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/CommentReadOwner.md b/cvat-sdk/docs/CommentReadOwner.md deleted file mode 100644 index c37a62f1..00000000 --- a/cvat-sdk/docs/CommentReadOwner.md +++ /dev/null @@ -1,16 +0,0 @@ -# CommentReadOwner - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | **str** | Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. | -**url** | **str** | | [optional] [readonly] -**id** | **int** | | [optional] [readonly] -**first_name** | **str** | | [optional] -**last_name** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/CommentWrite.md b/cvat-sdk/docs/CommentWrite.md deleted file mode 100644 index e530cca8..00000000 --- a/cvat-sdk/docs/CommentWrite.md +++ /dev/null @@ -1,18 +0,0 @@ -# CommentWrite - -Adds support for write once fields to serializers. To use it, specify a list of fields as `write_once_fields` on the serializer's Meta: ``` class Meta: model = SomeModel fields = '__all__' write_once_fields = ('collection', ) ``` Now the fields in `write_once_fields` can be set during POST (create), but cannot be changed afterwards via PUT or PATCH (update). Inspired by http://stackoverflow.com/a/37487134/627411. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**issue** | **int** | | -**id** | **int** | | [optional] [readonly] -**owner** | **int** | | [optional] [readonly] -**message** | **str** | | [optional] -**created_date** | **datetime** | | [optional] [readonly] -**updated_date** | **datetime** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/CommentWriteRequest.md b/cvat-sdk/docs/CommentWriteRequest.md deleted file mode 100644 index 53220481..00000000 --- a/cvat-sdk/docs/CommentWriteRequest.md +++ /dev/null @@ -1,14 +0,0 @@ -# CommentWriteRequest - -Adds support for write once fields to serializers. To use it, specify a list of fields as `write_once_fields` on the serializer's Meta: ``` class Meta: model = SomeModel fields = '__all__' write_once_fields = ('collection', ) ``` Now the fields in `write_once_fields` can be set during POST (create), but cannot be changed afterwards via PUT or PATCH (update). Inspired by http://stackoverflow.com/a/37487134/627411. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**issue** | **int** | | -**message** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/CommentsApi.md b/cvat-sdk/docs/CommentsApi.md deleted file mode 100644 index 796d3f4a..00000000 --- a/cvat-sdk/docs/CommentsApi.md +++ /dev/null @@ -1,580 +0,0 @@ -# cvat_sdk.CommentsApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**comments_create**](CommentsApi.md#comments_create) | **POST** /api/comments | Method creates a comment -[**comments_destroy**](CommentsApi.md#comments_destroy) | **DELETE** /api/comments/{id} | Method deletes a comment -[**comments_list**](CommentsApi.md#comments_list) | **GET** /api/comments | Method returns a paginated list of comments according to query parameters -[**comments_partial_update**](CommentsApi.md#comments_partial_update) | **PATCH** /api/comments/{id} | Methods does a partial update of chosen fields in a comment -[**comments_retrieve**](CommentsApi.md#comments_retrieve) | **GET** /api/comments/{id} | Method returns details of a comment - - -# **comments_create** -> CommentWrite comments_create(comment_write_request) - -Method creates a comment - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import comments_api -from cvat_sdk.model.comment_write import CommentWrite -from cvat_sdk.model.comment_write_request import CommentWriteRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = comments_api.CommentsApi(api_client) - comment_write_request = CommentWriteRequest( - issue=1, - message="message_example", - ) # CommentWriteRequest | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method creates a comment - api_response = api_instance.comments_create(comment_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling CommentsApi->comments_create: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method creates a comment - api_response = api_instance.comments_create(comment_write_request, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling CommentsApi->comments_create: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **comment_write_request** | [**CommentWriteRequest**](CommentWriteRequest.md)| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**CommentWrite**](CommentWrite.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **comments_destroy** -> comments_destroy(id) - -Method deletes a comment - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import comments_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = comments_api.CommentsApi(api_client) - id = 1 # int | A unique integer value identifying this comment. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method deletes a comment - api_instance.comments_destroy(id) - except cvat_sdk.ApiException as e: - print("Exception when calling CommentsApi->comments_destroy: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method deletes a comment - api_instance.comments_destroy(id, x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling CommentsApi->comments_destroy: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this comment. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | The comment has been deleted | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **comments_list** -> PaginatedCommentReadList comments_list() - -Method returns a paginated list of comments according to query parameters - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import comments_api -from cvat_sdk.model.paginated_comment_read_list import PaginatedCommentReadList -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = comments_api.CommentsApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - filter = "filter_example" # str | A filter term. Avaliable filter_fields: ['owner', 'id', 'issue_id'] (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - page = 1 # int | A page number within the paginated result set. (optional) - page_size = 1 # int | Number of results to return per page. (optional) - search = "search_example" # str | A search term. Avaliable search_fields: ('owner',) (optional) - sort = "sort_example" # str | Which field to use when ordering the results. Avaliable ordering_fields: ['owner', 'id', 'issue_id'] (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns a paginated list of comments according to query parameters - api_response = api_instance.comments_list(x_organization=x_organization, filter=filter, org=org, org_id=org_id, page=page, page_size=page_size, search=search, sort=sort) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling CommentsApi->comments_list: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **filter** | **str**| A filter term. Avaliable filter_fields: ['owner', 'id', 'issue_id'] | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **page** | **int**| A page number within the paginated result set. | [optional] - **page_size** | **int**| Number of results to return per page. | [optional] - **search** | **str**| A search term. Avaliable search_fields: ('owner',) | [optional] - **sort** | **str**| Which field to use when ordering the results. Avaliable ordering_fields: ['owner', 'id', 'issue_id'] | [optional] - -### Return type - -[**PaginatedCommentReadList**](PaginatedCommentReadList.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **comments_partial_update** -> CommentWrite comments_partial_update(id) - -Methods does a partial update of chosen fields in a comment - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import comments_api -from cvat_sdk.model.comment_write import CommentWrite -from cvat_sdk.model.patched_comment_write_request import PatchedCommentWriteRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = comments_api.CommentsApi(api_client) - id = 1 # int | A unique integer value identifying this comment. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - patched_comment_write_request = PatchedCommentWriteRequest( - issue=1, - message="message_example", - ) # PatchedCommentWriteRequest | (optional) - - # example passing only required values which don't have defaults set - try: - # Methods does a partial update of chosen fields in a comment - api_response = api_instance.comments_partial_update(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling CommentsApi->comments_partial_update: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Methods does a partial update of chosen fields in a comment - api_response = api_instance.comments_partial_update(id, x_organization=x_organization, org=org, org_id=org_id, patched_comment_write_request=patched_comment_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling CommentsApi->comments_partial_update: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this comment. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **patched_comment_write_request** | [**PatchedCommentWriteRequest**](PatchedCommentWriteRequest.md)| | [optional] - -### Return type - -[**CommentWrite**](CommentWrite.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **comments_retrieve** -> CommentRead comments_retrieve(id) - -Method returns details of a comment - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import comments_api -from cvat_sdk.model.comment_read import CommentRead -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = comments_api.CommentsApi(api_client) - id = 1 # int | A unique integer value identifying this comment. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method returns details of a comment - api_response = api_instance.comments_retrieve(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling CommentsApi->comments_retrieve: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns details of a comment - api_response = api_instance.comments_retrieve(id, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling CommentsApi->comments_retrieve: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this comment. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**CommentRead**](CommentRead.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/cvat-sdk/docs/CredentialsTypeEnum.md b/cvat-sdk/docs/CredentialsTypeEnum.md deleted file mode 100644 index 4ef3faff..00000000 --- a/cvat-sdk/docs/CredentialsTypeEnum.md +++ /dev/null @@ -1,11 +0,0 @@ -# CredentialsTypeEnum - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["KEY_SECRET_KEY_PAIR", "ACCOUNT_NAME_TOKEN_PAIR", "KEY_FILE_PATH", "ANONYMOUS_ACCESS", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/DataMetaRead.md b/cvat-sdk/docs/DataMetaRead.md deleted file mode 100644 index fda0c950..00000000 --- a/cvat-sdk/docs/DataMetaRead.md +++ /dev/null @@ -1,19 +0,0 @@ -# DataMetaRead - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**image_quality** | **int** | | -**frames** | [**[FrameMeta], none_type**](FrameMeta.md) | | -**deleted_frames** | **[int]** | | -**chunk_size** | **int** | | [optional] [readonly] -**size** | **int** | | [optional] [readonly] -**start_frame** | **int** | | [optional] [readonly] -**stop_frame** | **int** | | [optional] [readonly] -**frame_filter** | **str** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/DataRequest.md b/cvat-sdk/docs/DataRequest.md deleted file mode 100644 index 53585d9e..00000000 --- a/cvat-sdk/docs/DataRequest.md +++ /dev/null @@ -1,29 +0,0 @@ -# DataRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**image_quality** | **int** | | -**chunk_size** | **int, none_type** | | [optional] -**size** | **int** | | [optional] -**start_frame** | **int** | | [optional] -**stop_frame** | **int** | | [optional] -**frame_filter** | **str** | | [optional] -**compressed_chunk_type** | [**ChunkType**](ChunkType.md) | | [optional] -**original_chunk_type** | [**ChunkType**](ChunkType.md) | | [optional] -**client_files** | **[file_type]** | | [optional] if omitted the server will use the default value of [] -**server_files** | **[str]** | | [optional] if omitted the server will use the default value of [] -**remote_files** | **[str]** | | [optional] if omitted the server will use the default value of [] -**use_zip_chunks** | **bool** | | [optional] if omitted the server will use the default value of False -**cloud_storage_id** | **int, none_type** | | [optional] -**use_cache** | **bool** | | [optional] if omitted the server will use the default value of False -**copy_data** | **bool** | | [optional] if omitted the server will use the default value of False -**storage_method** | [**StorageMethod**](StorageMethod.md) | | [optional] -**storage** | [**StorageType**](StorageType.md) | | [optional] -**sorting_method** | [**SortingMethod**](SortingMethod.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/DatasetFileRequest.md b/cvat-sdk/docs/DatasetFileRequest.md deleted file mode 100644 index d7708c7f..00000000 --- a/cvat-sdk/docs/DatasetFileRequest.md +++ /dev/null @@ -1,12 +0,0 @@ -# DatasetFileRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**dataset_file** | **file_type** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/DatasetFormat.md b/cvat-sdk/docs/DatasetFormat.md deleted file mode 100644 index 27a11c91..00000000 --- a/cvat-sdk/docs/DatasetFormat.md +++ /dev/null @@ -1,16 +0,0 @@ -# DatasetFormat - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | -**ext** | **str** | | -**version** | **str** | | -**enabled** | **bool** | | -**dimension** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/DatasetFormats.md b/cvat-sdk/docs/DatasetFormats.md deleted file mode 100644 index acd9428a..00000000 --- a/cvat-sdk/docs/DatasetFormats.md +++ /dev/null @@ -1,13 +0,0 @@ -# DatasetFormats - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**importers** | [**[DatasetFormat]**](DatasetFormat.md) | | -**exporters** | [**[DatasetFormat]**](DatasetFormat.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/Exception.md b/cvat-sdk/docs/Exception.md deleted file mode 100644 index 50ff9afc..00000000 --- a/cvat-sdk/docs/Exception.md +++ /dev/null @@ -1,23 +0,0 @@ -# Exception - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**system** | **str** | | -**client** | **str** | | -**time** | **datetime** | | -**client_id** | **int** | | -**message** | **str** | | -**filename** | **str** | | -**line** | **int** | | -**column** | **int** | | -**stack** | **str** | | -**job_id** | **int** | | [optional] -**task_id** | **int** | | [optional] -**proj_id** | **int** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/ExceptionRequest.md b/cvat-sdk/docs/ExceptionRequest.md deleted file mode 100644 index be644096..00000000 --- a/cvat-sdk/docs/ExceptionRequest.md +++ /dev/null @@ -1,23 +0,0 @@ -# ExceptionRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**system** | **str** | | -**client** | **str** | | -**time** | **datetime** | | -**client_id** | **int** | | -**message** | **str** | | -**filename** | **str** | | -**line** | **int** | | -**column** | **int** | | -**stack** | **str** | | -**job_id** | **int** | | [optional] -**task_id** | **int** | | [optional] -**proj_id** | **int** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/FileInfo.md b/cvat-sdk/docs/FileInfo.md deleted file mode 100644 index 99e01889..00000000 --- a/cvat-sdk/docs/FileInfo.md +++ /dev/null @@ -1,13 +0,0 @@ -# FileInfo - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | -**type** | [**FileInfoTypeEnum**](FileInfoTypeEnum.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/FileInfoTypeEnum.md b/cvat-sdk/docs/FileInfoTypeEnum.md deleted file mode 100644 index 7c738e7a..00000000 --- a/cvat-sdk/docs/FileInfoTypeEnum.md +++ /dev/null @@ -1,11 +0,0 @@ -# FileInfoTypeEnum - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["REG", "DIR", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/FrameMeta.md b/cvat-sdk/docs/FrameMeta.md deleted file mode 100644 index 9b0f5165..00000000 --- a/cvat-sdk/docs/FrameMeta.md +++ /dev/null @@ -1,15 +0,0 @@ -# FrameMeta - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**width** | **int** | | -**height** | **int** | | -**name** | **str** | | -**has_related_context** | **bool** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/InputTypeEnum.md b/cvat-sdk/docs/InputTypeEnum.md deleted file mode 100644 index 19c7d533..00000000 --- a/cvat-sdk/docs/InputTypeEnum.md +++ /dev/null @@ -1,11 +0,0 @@ -# InputTypeEnum - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["checkbox", "radio", "number", "text", "select", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/InvitationRead.md b/cvat-sdk/docs/InvitationRead.md deleted file mode 100644 index 0722a400..00000000 --- a/cvat-sdk/docs/InvitationRead.md +++ /dev/null @@ -1,17 +0,0 @@ -# InvitationRead - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**owner** | [**BasicUser**](BasicUser.md) | | -**role** | [**RoleEnum**](RoleEnum.md) | | -**user** | [**BasicUser**](BasicUser.md) | | -**organization** | **int** | | -**key** | **str** | | [optional] [readonly] -**created_date** | **datetime** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/InvitationWrite.md b/cvat-sdk/docs/InvitationWrite.md deleted file mode 100644 index f143b708..00000000 --- a/cvat-sdk/docs/InvitationWrite.md +++ /dev/null @@ -1,17 +0,0 @@ -# InvitationWrite - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**role** | [**RoleEnum**](RoleEnum.md) | | -**email** | **str** | | -**key** | **str** | | [optional] [readonly] -**created_date** | **datetime** | | [optional] [readonly] -**owner** | **int** | | [optional] [readonly] -**organization** | **int** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/InvitationWriteRequest.md b/cvat-sdk/docs/InvitationWriteRequest.md deleted file mode 100644 index 074a30d9..00000000 --- a/cvat-sdk/docs/InvitationWriteRequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# InvitationWriteRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**role** | [**RoleEnum**](RoleEnum.md) | | -**email** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/InvitationsApi.md b/cvat-sdk/docs/InvitationsApi.md deleted file mode 100644 index 60b9c69e..00000000 --- a/cvat-sdk/docs/InvitationsApi.md +++ /dev/null @@ -1,580 +0,0 @@ -# cvat_sdk.InvitationsApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**invitations_create**](InvitationsApi.md#invitations_create) | **POST** /api/invitations | Method creates an invitation -[**invitations_destroy**](InvitationsApi.md#invitations_destroy) | **DELETE** /api/invitations/{key} | Method deletes an invitation -[**invitations_list**](InvitationsApi.md#invitations_list) | **GET** /api/invitations | Method returns a paginated list of invitations according to query parameters -[**invitations_partial_update**](InvitationsApi.md#invitations_partial_update) | **PATCH** /api/invitations/{key} | Methods does a partial update of chosen fields in an invitation -[**invitations_retrieve**](InvitationsApi.md#invitations_retrieve) | **GET** /api/invitations/{key} | Method returns details of an invitation - - -# **invitations_create** -> InvitationWrite invitations_create(invitation_write_request) - -Method creates an invitation - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import invitations_api -from cvat_sdk.model.invitation_write import InvitationWrite -from cvat_sdk.model.invitation_write_request import InvitationWriteRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = invitations_api.InvitationsApi(api_client) - invitation_write_request = InvitationWriteRequest( - role=RoleEnum("worker"), - email="email_example", - ) # InvitationWriteRequest | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method creates an invitation - api_response = api_instance.invitations_create(invitation_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling InvitationsApi->invitations_create: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method creates an invitation - api_response = api_instance.invitations_create(invitation_write_request, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling InvitationsApi->invitations_create: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **invitation_write_request** | [**InvitationWriteRequest**](InvitationWriteRequest.md)| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**InvitationWrite**](InvitationWrite.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **invitations_destroy** -> invitations_destroy(key) - -Method deletes an invitation - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import invitations_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = invitations_api.InvitationsApi(api_client) - key = "key_example" # str | A unique value identifying this invitation. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method deletes an invitation - api_instance.invitations_destroy(key) - except cvat_sdk.ApiException as e: - print("Exception when calling InvitationsApi->invitations_destroy: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method deletes an invitation - api_instance.invitations_destroy(key, x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling InvitationsApi->invitations_destroy: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **key** | **str**| A unique value identifying this invitation. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | The invitation has been deleted | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **invitations_list** -> PaginatedInvitationReadList invitations_list() - -Method returns a paginated list of invitations according to query parameters - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import invitations_api -from cvat_sdk.model.paginated_invitation_read_list import PaginatedInvitationReadList -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = invitations_api.InvitationsApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - filter = "filter_example" # str | A filter term. Avaliable filter_fields: ('owner',) (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - page = 1 # int | A page number within the paginated result set. (optional) - page_size = 1 # int | Number of results to return per page. (optional) - search = "search_example" # str | A search term. Avaliable search_fields: ('owner',) (optional) - sort = "sort_example" # str | Which field to use when ordering the results. Avaliable ordering_fields: ['owner', 'created_date'] (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns a paginated list of invitations according to query parameters - api_response = api_instance.invitations_list(x_organization=x_organization, filter=filter, org=org, org_id=org_id, page=page, page_size=page_size, search=search, sort=sort) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling InvitationsApi->invitations_list: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **filter** | **str**| A filter term. Avaliable filter_fields: ('owner',) | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **page** | **int**| A page number within the paginated result set. | [optional] - **page_size** | **int**| Number of results to return per page. | [optional] - **search** | **str**| A search term. Avaliable search_fields: ('owner',) | [optional] - **sort** | **str**| Which field to use when ordering the results. Avaliable ordering_fields: ['owner', 'created_date'] | [optional] - -### Return type - -[**PaginatedInvitationReadList**](PaginatedInvitationReadList.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **invitations_partial_update** -> InvitationWrite invitations_partial_update(key) - -Methods does a partial update of chosen fields in an invitation - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import invitations_api -from cvat_sdk.model.patched_invitation_write_request import PatchedInvitationWriteRequest -from cvat_sdk.model.invitation_write import InvitationWrite -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = invitations_api.InvitationsApi(api_client) - key = "key_example" # str | A unique value identifying this invitation. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - patched_invitation_write_request = PatchedInvitationWriteRequest( - role=RoleEnum("worker"), - email="email_example", - ) # PatchedInvitationWriteRequest | (optional) - - # example passing only required values which don't have defaults set - try: - # Methods does a partial update of chosen fields in an invitation - api_response = api_instance.invitations_partial_update(key) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling InvitationsApi->invitations_partial_update: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Methods does a partial update of chosen fields in an invitation - api_response = api_instance.invitations_partial_update(key, x_organization=x_organization, org=org, org_id=org_id, patched_invitation_write_request=patched_invitation_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling InvitationsApi->invitations_partial_update: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **key** | **str**| A unique value identifying this invitation. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **patched_invitation_write_request** | [**PatchedInvitationWriteRequest**](PatchedInvitationWriteRequest.md)| | [optional] - -### Return type - -[**InvitationWrite**](InvitationWrite.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **invitations_retrieve** -> InvitationRead invitations_retrieve(key) - -Method returns details of an invitation - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import invitations_api -from cvat_sdk.model.invitation_read import InvitationRead -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = invitations_api.InvitationsApi(api_client) - key = "key_example" # str | A unique value identifying this invitation. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method returns details of an invitation - api_response = api_instance.invitations_retrieve(key) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling InvitationsApi->invitations_retrieve: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns details of an invitation - api_response = api_instance.invitations_retrieve(key, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling InvitationsApi->invitations_retrieve: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **key** | **str**| A unique value identifying this invitation. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**InvitationRead**](InvitationRead.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/cvat-sdk/docs/IssueRead.md b/cvat-sdk/docs/IssueRead.md deleted file mode 100644 index 6bfe313f..00000000 --- a/cvat-sdk/docs/IssueRead.md +++ /dev/null @@ -1,21 +0,0 @@ -# IssueRead - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**position** | **[float]** | | -**comments** | [**[CommentRead]**](CommentRead.md) | | -**id** | **int** | | [optional] [readonly] -**frame** | **int** | | [optional] [readonly] -**job** | **int** | | [optional] [readonly] -**owner** | [**CommentReadOwner**](CommentReadOwner.md) | | [optional] -**assignee** | [**CommentReadOwner**](CommentReadOwner.md) | | [optional] -**created_date** | **datetime** | | [optional] [readonly] -**updated_date** | **datetime** | | [optional] [readonly] -**resolved** | **bool** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/IssueWrite.md b/cvat-sdk/docs/IssueWrite.md deleted file mode 100644 index c9ca7fd4..00000000 --- a/cvat-sdk/docs/IssueWrite.md +++ /dev/null @@ -1,22 +0,0 @@ -# IssueWrite - -Adds support for write once fields to serializers. To use it, specify a list of fields as `write_once_fields` on the serializer's Meta: ``` class Meta: model = SomeModel fields = '__all__' write_once_fields = ('collection', ) ``` Now the fields in `write_once_fields` can be set during POST (create), but cannot be changed afterwards via PUT or PATCH (update). Inspired by http://stackoverflow.com/a/37487134/627411. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**frame** | **int** | | -**position** | **[float]** | | -**job** | **int** | | -**message** | **str** | | -**id** | **int** | | [optional] [readonly] -**owner** | **int** | | [optional] [readonly] -**assignee** | **int, none_type** | | [optional] -**created_date** | **datetime** | | [optional] [readonly] -**updated_date** | **datetime** | | [optional] [readonly] -**resolved** | **bool** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/IssueWriteRequest.md b/cvat-sdk/docs/IssueWriteRequest.md deleted file mode 100644 index fc0ba6d5..00000000 --- a/cvat-sdk/docs/IssueWriteRequest.md +++ /dev/null @@ -1,18 +0,0 @@ -# IssueWriteRequest - -Adds support for write once fields to serializers. To use it, specify a list of fields as `write_once_fields` on the serializer's Meta: ``` class Meta: model = SomeModel fields = '__all__' write_once_fields = ('collection', ) ``` Now the fields in `write_once_fields` can be set during POST (create), but cannot be changed afterwards via PUT or PATCH (update). Inspired by http://stackoverflow.com/a/37487134/627411. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**frame** | **int** | | -**position** | **[float]** | | -**job** | **int** | | -**message** | **str** | | -**assignee** | **int, none_type** | | [optional] -**resolved** | **bool** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/IssuesApi.md b/cvat-sdk/docs/IssuesApi.md deleted file mode 100644 index a383c080..00000000 --- a/cvat-sdk/docs/IssuesApi.md +++ /dev/null @@ -1,715 +0,0 @@ -# cvat_sdk.IssuesApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**issues_create**](IssuesApi.md#issues_create) | **POST** /api/issues | Method creates an issue -[**issues_destroy**](IssuesApi.md#issues_destroy) | **DELETE** /api/issues/{id} | Method deletes an issue -[**issues_list**](IssuesApi.md#issues_list) | **GET** /api/issues | Method returns a paginated list of issues according to query parameters -[**issues_list_comments**](IssuesApi.md#issues_list_comments) | **GET** /api/issues/{id}/comments | The action returns all comments of a specific issue -[**issues_partial_update**](IssuesApi.md#issues_partial_update) | **PATCH** /api/issues/{id} | Methods does a partial update of chosen fields in an issue -[**issues_retrieve**](IssuesApi.md#issues_retrieve) | **GET** /api/issues/{id} | Method returns details of an issue - - -# **issues_create** -> IssueWrite issues_create(issue_write_request) - -Method creates an issue - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import issues_api -from cvat_sdk.model.issue_write_request import IssueWriteRequest -from cvat_sdk.model.issue_write import IssueWrite -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = issues_api.IssuesApi(api_client) - issue_write_request = IssueWriteRequest( - frame=1, - position=[ - 3.14, - ], - job=1, - assignee=1, - message="message_example", - resolved=True, - ) # IssueWriteRequest | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method creates an issue - api_response = api_instance.issues_create(issue_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling IssuesApi->issues_create: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method creates an issue - api_response = api_instance.issues_create(issue_write_request, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling IssuesApi->issues_create: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **issue_write_request** | [**IssueWriteRequest**](IssueWriteRequest.md)| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**IssueWrite**](IssueWrite.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **issues_destroy** -> issues_destroy(id) - -Method deletes an issue - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import issues_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = issues_api.IssuesApi(api_client) - id = 1 # int | A unique integer value identifying this issue. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method deletes an issue - api_instance.issues_destroy(id) - except cvat_sdk.ApiException as e: - print("Exception when calling IssuesApi->issues_destroy: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method deletes an issue - api_instance.issues_destroy(id, x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling IssuesApi->issues_destroy: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this issue. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | The issue has been deleted | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **issues_list** -> PaginatedIssueReadList issues_list() - -Method returns a paginated list of issues according to query parameters - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import issues_api -from cvat_sdk.model.paginated_issue_read_list import PaginatedIssueReadList -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = issues_api.IssuesApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - filter = "filter_example" # str | A filter term. Avaliable filter_fields: ['owner', 'assignee', 'id', 'job_id', 'task_id', 'resolved'] (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - page = 1 # int | A page number within the paginated result set. (optional) - page_size = 1 # int | Number of results to return per page. (optional) - search = "search_example" # str | A search term. Avaliable search_fields: ('owner', 'assignee') (optional) - sort = "sort_example" # str | Which field to use when ordering the results. Avaliable ordering_fields: ['owner', 'assignee', 'id', 'job_id', 'task_id', 'resolved'] (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns a paginated list of issues according to query parameters - api_response = api_instance.issues_list(x_organization=x_organization, filter=filter, org=org, org_id=org_id, page=page, page_size=page_size, search=search, sort=sort) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling IssuesApi->issues_list: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **filter** | **str**| A filter term. Avaliable filter_fields: ['owner', 'assignee', 'id', 'job_id', 'task_id', 'resolved'] | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **page** | **int**| A page number within the paginated result set. | [optional] - **page_size** | **int**| Number of results to return per page. | [optional] - **search** | **str**| A search term. Avaliable search_fields: ('owner', 'assignee') | [optional] - **sort** | **str**| Which field to use when ordering the results. Avaliable ordering_fields: ['owner', 'assignee', 'id', 'job_id', 'task_id', 'resolved'] | [optional] - -### Return type - -[**PaginatedIssueReadList**](PaginatedIssueReadList.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **issues_list_comments** -> PaginatedCommentReadList issues_list_comments(id) - -The action returns all comments of a specific issue - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import issues_api -from cvat_sdk.model.paginated_comment_read_list import PaginatedCommentReadList -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = issues_api.IssuesApi(api_client) - id = 1 # int | A unique integer value identifying this issue. - x_organization = "X-Organization_example" # str | (optional) - filter = "filter_example" # str | A filter term. Avaliable filter_fields: ['owner', 'assignee', 'id', 'job_id', 'task_id', 'resolved'] (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - page = 1 # int | A page number within the paginated result set. (optional) - page_size = 1 # int | Number of results to return per page. (optional) - search = "search_example" # str | A search term. Avaliable search_fields: ('owner', 'assignee') (optional) - sort = "sort_example" # str | Which field to use when ordering the results. Avaliable ordering_fields: ['owner', 'assignee', 'id', 'job_id', 'task_id', 'resolved'] (optional) - - # example passing only required values which don't have defaults set - try: - # The action returns all comments of a specific issue - api_response = api_instance.issues_list_comments(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling IssuesApi->issues_list_comments: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # The action returns all comments of a specific issue - api_response = api_instance.issues_list_comments(id, x_organization=x_organization, filter=filter, org=org, org_id=org_id, page=page, page_size=page_size, search=search, sort=sort) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling IssuesApi->issues_list_comments: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this issue. | - **x_organization** | **str**| | [optional] - **filter** | **str**| A filter term. Avaliable filter_fields: ['owner', 'assignee', 'id', 'job_id', 'task_id', 'resolved'] | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **page** | **int**| A page number within the paginated result set. | [optional] - **page_size** | **int**| Number of results to return per page. | [optional] - **search** | **str**| A search term. Avaliable search_fields: ('owner', 'assignee') | [optional] - **sort** | **str**| Which field to use when ordering the results. Avaliable ordering_fields: ['owner', 'assignee', 'id', 'job_id', 'task_id', 'resolved'] | [optional] - -### Return type - -[**PaginatedCommentReadList**](PaginatedCommentReadList.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **issues_partial_update** -> IssueWrite issues_partial_update(id) - -Methods does a partial update of chosen fields in an issue - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import issues_api -from cvat_sdk.model.issue_write import IssueWrite -from cvat_sdk.model.patched_issue_write_request import PatchedIssueWriteRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = issues_api.IssuesApi(api_client) - id = 1 # int | A unique integer value identifying this issue. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - patched_issue_write_request = PatchedIssueWriteRequest( - frame=1, - position=[ - 3.14, - ], - job=1, - assignee=1, - message="message_example", - resolved=True, - ) # PatchedIssueWriteRequest | (optional) - - # example passing only required values which don't have defaults set - try: - # Methods does a partial update of chosen fields in an issue - api_response = api_instance.issues_partial_update(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling IssuesApi->issues_partial_update: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Methods does a partial update of chosen fields in an issue - api_response = api_instance.issues_partial_update(id, x_organization=x_organization, org=org, org_id=org_id, patched_issue_write_request=patched_issue_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling IssuesApi->issues_partial_update: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this issue. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **patched_issue_write_request** | [**PatchedIssueWriteRequest**](PatchedIssueWriteRequest.md)| | [optional] - -### Return type - -[**IssueWrite**](IssueWrite.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **issues_retrieve** -> IssueRead issues_retrieve(id) - -Method returns details of an issue - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import issues_api -from cvat_sdk.model.issue_read import IssueRead -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = issues_api.IssuesApi(api_client) - id = 1 # int | A unique integer value identifying this issue. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method returns details of an issue - api_response = api_instance.issues_retrieve(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling IssuesApi->issues_retrieve: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns details of an issue - api_response = api_instance.issues_retrieve(id, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling IssuesApi->issues_retrieve: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this issue. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**IssueRead**](IssueRead.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/cvat-sdk/docs/JobCommit.md b/cvat-sdk/docs/JobCommit.md deleted file mode 100644 index a61e05ab..00000000 --- a/cvat-sdk/docs/JobCommit.md +++ /dev/null @@ -1,16 +0,0 @@ -# JobCommit - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [readonly] -**owner** | **int, none_type** | | [optional] -**data** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] -**timestamp** | **datetime** | | [optional] [readonly] -**scope** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/JobRead.md b/cvat-sdk/docs/JobRead.md deleted file mode 100644 index ae7f0bae..00000000 --- a/cvat-sdk/docs/JobRead.md +++ /dev/null @@ -1,28 +0,0 @@ -# JobRead - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**assignee** | [**CommentReadOwner**](CommentReadOwner.md) | | -**dimension** | **str** | | -**labels** | [**[Label]**](Label.md) | | -**bug_tracker** | **str, none_type** | | -**url** | **str** | | [optional] [readonly] -**id** | **int** | | [optional] [readonly] -**task_id** | **int** | | [optional] [readonly] -**project_id** | **int, none_type** | | [optional] [readonly] -**status** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] [readonly] -**stage** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] [readonly] -**state** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] [readonly] -**mode** | **str** | | [optional] [readonly] -**start_frame** | **int** | | [optional] [readonly] -**stop_frame** | **int** | | [optional] [readonly] -**data_chunk_size** | **int, none_type** | | [optional] [readonly] -**data_compressed_chunk_type** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] [readonly] -**updated_date** | **datetime** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/JobStage.md b/cvat-sdk/docs/JobStage.md deleted file mode 100644 index 64e2fb76..00000000 --- a/cvat-sdk/docs/JobStage.md +++ /dev/null @@ -1,11 +0,0 @@ -# JobStage - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["annotation", "validation", "acceptance", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/JobStatus.md b/cvat-sdk/docs/JobStatus.md deleted file mode 100644 index e4fcf701..00000000 --- a/cvat-sdk/docs/JobStatus.md +++ /dev/null @@ -1,11 +0,0 @@ -# JobStatus - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["annotation", "validation", "completed", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/JobWrite.md b/cvat-sdk/docs/JobWrite.md deleted file mode 100644 index e2460e0f..00000000 --- a/cvat-sdk/docs/JobWrite.md +++ /dev/null @@ -1,14 +0,0 @@ -# JobWrite - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**assignee** | **int, none_type** | | [optional] -**stage** | [**JobStage**](JobStage.md) | | [optional] -**state** | [**OperationStatus**](OperationStatus.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/JobWriteRequest.md b/cvat-sdk/docs/JobWriteRequest.md deleted file mode 100644 index 97923da5..00000000 --- a/cvat-sdk/docs/JobWriteRequest.md +++ /dev/null @@ -1,14 +0,0 @@ -# JobWriteRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**assignee** | **int, none_type** | | [optional] -**stage** | [**JobStage**](JobStage.md) | | [optional] -**state** | [**OperationStatus**](OperationStatus.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/JobsApi.md b/cvat-sdk/docs/JobsApi.md deleted file mode 100644 index 4c82ee13..00000000 --- a/cvat-sdk/docs/JobsApi.md +++ /dev/null @@ -1,1785 +0,0 @@ -# cvat_sdk.JobsApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**jobs_create_annotations**](JobsApi.md#jobs_create_annotations) | **POST** /api/jobs/{id}/annotations/ | Method allows to upload job annotations -[**jobs_destroy_annotations**](JobsApi.md#jobs_destroy_annotations) | **DELETE** /api/jobs/{id}/annotations/ | Method deletes all annotations for a specific job -[**jobs_list**](JobsApi.md#jobs_list) | **GET** /api/jobs | Method returns a paginated list of jobs according to query parameters -[**jobs_list_commits**](JobsApi.md#jobs_list_commits) | **GET** /api/jobs/{id}/commits | The action returns the list of tracked changes for the job -[**jobs_list_issues**](JobsApi.md#jobs_list_issues) | **GET** /api/jobs/{id}/issues | Method returns list of issues for the job -[**jobs_partial_update**](JobsApi.md#jobs_partial_update) | **PATCH** /api/jobs/{id} | Methods does a partial update of chosen fields in a job -[**jobs_partial_update_annotations**](JobsApi.md#jobs_partial_update_annotations) | **PATCH** /api/jobs/{id}/annotations/ | Method performs a partial update of annotations in a specific job -[**jobs_partial_update_annotations_file**](JobsApi.md#jobs_partial_update_annotations_file) | **PATCH** /api/jobs/{id}/annotations/{file_id} | Allows to upload an annotation file chunk. Implements TUS file uploading protocol. -[**jobs_retrieve**](JobsApi.md#jobs_retrieve) | **GET** /api/jobs/{id} | Method returns details of a job -[**jobs_retrieve_annotations**](JobsApi.md#jobs_retrieve_annotations) | **GET** /api/jobs/{id}/annotations/ | Method returns annotations for a specific job -[**jobs_retrieve_data**](JobsApi.md#jobs_retrieve_data) | **GET** /api/jobs/{id}/data | Method returns data for a specific job -[**jobs_retrieve_data_meta**](JobsApi.md#jobs_retrieve_data_meta) | **GET** /api/jobs/{id}/data/meta | Method provides a meta information about media files which are related with the job -[**jobs_retrieve_dataset**](JobsApi.md#jobs_retrieve_dataset) | **GET** /api/jobs/{id}/dataset | Export job as a dataset in a specific format -[**jobs_update**](JobsApi.md#jobs_update) | **PUT** /api/jobs/{id} | Method updates a job by id -[**jobs_update_annotations**](JobsApi.md#jobs_update_annotations) | **PUT** /api/jobs/{id}/annotations/ | Method performs an update of all annotations in a specific job - - -# **jobs_create_annotations** -> jobs_create_annotations(id) - -Method allows to upload job annotations - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import jobs_api -from cvat_sdk.model.job_write_request import JobWriteRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = jobs_api.JobsApi(api_client) - id = 1 # int | A unique integer value identifying this job. - x_organization = "X-Organization_example" # str | (optional) - cloud_storage_id = 3.14 # float | Storage id (optional) - filename = "filename_example" # str | Annotation file name (optional) - format = "format_example" # str | Input format name You can get the list of supported formats at: /server/annotation/formats (optional) - location = "cloud_storage" # str | where to import the annotation from (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - use_default_location = True # bool | Use the location that was configured in the task to import annotation (optional) if omitted the server will use the default value of True - job_write_request = JobWriteRequest( - assignee=1, - stage=JobStage("annotation"), - state=OperationStatus("new"), - ) # JobWriteRequest | (optional) - - # example passing only required values which don't have defaults set - try: - # Method allows to upload job annotations - api_instance.jobs_create_annotations(id) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_create_annotations: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method allows to upload job annotations - api_instance.jobs_create_annotations(id, x_organization=x_organization, cloud_storage_id=cloud_storage_id, filename=filename, format=format, location=location, org=org, org_id=org_id, use_default_location=use_default_location, job_write_request=job_write_request) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_create_annotations: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this job. | - **x_organization** | **str**| | [optional] - **cloud_storage_id** | **float**| Storage id | [optional] - **filename** | **str**| Annotation file name | [optional] - **format** | **str**| Input format name You can get the list of supported formats at: /server/annotation/formats | [optional] - **location** | **str**| where to import the annotation from | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **use_default_location** | **bool**| Use the location that was configured in the task to import annotation | [optional] if omitted the server will use the default value of True - **job_write_request** | [**JobWriteRequest**](JobWriteRequest.md)| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | Uploading has finished | - | -**202** | Uploading has been started | - | -**405** | Format is not available | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **jobs_destroy_annotations** -> jobs_destroy_annotations(id) - -Method deletes all annotations for a specific job - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import jobs_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = jobs_api.JobsApi(api_client) - id = 1 # int | A unique integer value identifying this job. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method deletes all annotations for a specific job - api_instance.jobs_destroy_annotations(id) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_destroy_annotations: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method deletes all annotations for a specific job - api_instance.jobs_destroy_annotations(id, x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_destroy_annotations: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this job. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | The annotation has been deleted | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **jobs_list** -> PaginatedJobReadList jobs_list() - -Method returns a paginated list of jobs according to query parameters - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import jobs_api -from cvat_sdk.model.paginated_job_read_list import PaginatedJobReadList -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = jobs_api.JobsApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - filter = "filter_example" # str | A filter term. Avaliable filter_fields: ['task_name', 'project_name', 'assignee', 'state', 'stage', 'id', 'task_id', 'project_id', 'updated_date'] (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - page = 1 # int | A page number within the paginated result set. (optional) - page_size = 1 # int | Number of results to return per page. (optional) - search = "search_example" # str | A search term. Avaliable search_fields: ('task_name', 'project_name', 'assignee', 'state', 'stage') (optional) - sort = "sort_example" # str | Which field to use when ordering the results. Avaliable ordering_fields: ['task_name', 'project_name', 'assignee', 'state', 'stage', 'id', 'task_id', 'project_id', 'updated_date'] (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns a paginated list of jobs according to query parameters - api_response = api_instance.jobs_list(x_organization=x_organization, filter=filter, org=org, org_id=org_id, page=page, page_size=page_size, search=search, sort=sort) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_list: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **filter** | **str**| A filter term. Avaliable filter_fields: ['task_name', 'project_name', 'assignee', 'state', 'stage', 'id', 'task_id', 'project_id', 'updated_date'] | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **page** | **int**| A page number within the paginated result set. | [optional] - **page_size** | **int**| Number of results to return per page. | [optional] - **search** | **str**| A search term. Avaliable search_fields: ('task_name', 'project_name', 'assignee', 'state', 'stage') | [optional] - **sort** | **str**| Which field to use when ordering the results. Avaliable ordering_fields: ['task_name', 'project_name', 'assignee', 'state', 'stage', 'id', 'task_id', 'project_id', 'updated_date'] | [optional] - -### Return type - -[**PaginatedJobReadList**](PaginatedJobReadList.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **jobs_list_commits** -> PaginatedJobCommitList jobs_list_commits(id) - -The action returns the list of tracked changes for the job - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import jobs_api -from cvat_sdk.model.paginated_job_commit_list import PaginatedJobCommitList -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = jobs_api.JobsApi(api_client) - id = 1 # int | A unique integer value identifying this job. - x_organization = "X-Organization_example" # str | (optional) - filter = "filter_example" # str | A filter term. Avaliable filter_fields: ['task_name', 'project_name', 'assignee', 'state', 'stage', 'id', 'task_id', 'project_id', 'updated_date'] (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - page = 1 # int | A page number within the paginated result set. (optional) - page_size = 1 # int | Number of results to return per page. (optional) - search = "search_example" # str | A search term. Avaliable search_fields: ('task_name', 'project_name', 'assignee', 'state', 'stage') (optional) - sort = "sort_example" # str | Which field to use when ordering the results. Avaliable ordering_fields: ['task_name', 'project_name', 'assignee', 'state', 'stage', 'id', 'task_id', 'project_id', 'updated_date'] (optional) - - # example passing only required values which don't have defaults set - try: - # The action returns the list of tracked changes for the job - api_response = api_instance.jobs_list_commits(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_list_commits: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # The action returns the list of tracked changes for the job - api_response = api_instance.jobs_list_commits(id, x_organization=x_organization, filter=filter, org=org, org_id=org_id, page=page, page_size=page_size, search=search, sort=sort) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_list_commits: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this job. | - **x_organization** | **str**| | [optional] - **filter** | **str**| A filter term. Avaliable filter_fields: ['task_name', 'project_name', 'assignee', 'state', 'stage', 'id', 'task_id', 'project_id', 'updated_date'] | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **page** | **int**| A page number within the paginated result set. | [optional] - **page_size** | **int**| Number of results to return per page. | [optional] - **search** | **str**| A search term. Avaliable search_fields: ('task_name', 'project_name', 'assignee', 'state', 'stage') | [optional] - **sort** | **str**| Which field to use when ordering the results. Avaliable ordering_fields: ['task_name', 'project_name', 'assignee', 'state', 'stage', 'id', 'task_id', 'project_id', 'updated_date'] | [optional] - -### Return type - -[**PaginatedJobCommitList**](PaginatedJobCommitList.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **jobs_list_issues** -> PaginatedIssueReadList jobs_list_issues(id) - -Method returns list of issues for the job - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import jobs_api -from cvat_sdk.model.paginated_issue_read_list import PaginatedIssueReadList -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = jobs_api.JobsApi(api_client) - id = 1 # int | A unique integer value identifying this job. - x_organization = "X-Organization_example" # str | (optional) - filter = "filter_example" # str | A filter term. Avaliable filter_fields: ['task_name', 'project_name', 'assignee', 'state', 'stage', 'id', 'task_id', 'project_id', 'updated_date'] (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - page = 1 # int | A page number within the paginated result set. (optional) - page_size = 1 # int | Number of results to return per page. (optional) - search = "search_example" # str | A search term. Avaliable search_fields: ('task_name', 'project_name', 'assignee', 'state', 'stage') (optional) - sort = "sort_example" # str | Which field to use when ordering the results. Avaliable ordering_fields: ['task_name', 'project_name', 'assignee', 'state', 'stage', 'id', 'task_id', 'project_id', 'updated_date'] (optional) - - # example passing only required values which don't have defaults set - try: - # Method returns list of issues for the job - api_response = api_instance.jobs_list_issues(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_list_issues: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns list of issues for the job - api_response = api_instance.jobs_list_issues(id, x_organization=x_organization, filter=filter, org=org, org_id=org_id, page=page, page_size=page_size, search=search, sort=sort) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_list_issues: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this job. | - **x_organization** | **str**| | [optional] - **filter** | **str**| A filter term. Avaliable filter_fields: ['task_name', 'project_name', 'assignee', 'state', 'stage', 'id', 'task_id', 'project_id', 'updated_date'] | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **page** | **int**| A page number within the paginated result set. | [optional] - **page_size** | **int**| Number of results to return per page. | [optional] - **search** | **str**| A search term. Avaliable search_fields: ('task_name', 'project_name', 'assignee', 'state', 'stage') | [optional] - **sort** | **str**| Which field to use when ordering the results. Avaliable ordering_fields: ['task_name', 'project_name', 'assignee', 'state', 'stage', 'id', 'task_id', 'project_id', 'updated_date'] | [optional] - -### Return type - -[**PaginatedIssueReadList**](PaginatedIssueReadList.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **jobs_partial_update** -> JobWrite jobs_partial_update(id) - -Methods does a partial update of chosen fields in a job - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import jobs_api -from cvat_sdk.model.patched_job_write_request import PatchedJobWriteRequest -from cvat_sdk.model.job_write import JobWrite -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = jobs_api.JobsApi(api_client) - id = 1 # int | A unique integer value identifying this job. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - patched_job_write_request = PatchedJobWriteRequest( - assignee=1, - stage=JobStage("annotation"), - state=OperationStatus("new"), - ) # PatchedJobWriteRequest | (optional) - - # example passing only required values which don't have defaults set - try: - # Methods does a partial update of chosen fields in a job - api_response = api_instance.jobs_partial_update(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_partial_update: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Methods does a partial update of chosen fields in a job - api_response = api_instance.jobs_partial_update(id, x_organization=x_organization, org=org, org_id=org_id, patched_job_write_request=patched_job_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_partial_update: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this job. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **patched_job_write_request** | [**PatchedJobWriteRequest**](PatchedJobWriteRequest.md)| | [optional] - -### Return type - -[**JobWrite**](JobWrite.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **jobs_partial_update_annotations** -> jobs_partial_update_annotations(action, id) - -Method performs a partial update of annotations in a specific job - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import jobs_api -from cvat_sdk.model.patched_job_write_request import PatchedJobWriteRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = jobs_api.JobsApi(api_client) - action = "create" # str | - id = 1 # int | A unique integer value identifying this job. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - patched_job_write_request = PatchedJobWriteRequest( - assignee=1, - stage=JobStage("annotation"), - state=OperationStatus("new"), - ) # PatchedJobWriteRequest | (optional) - - # example passing only required values which don't have defaults set - try: - # Method performs a partial update of annotations in a specific job - api_instance.jobs_partial_update_annotations(action, id) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_partial_update_annotations: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method performs a partial update of annotations in a specific job - api_instance.jobs_partial_update_annotations(action, id, x_organization=x_organization, org=org, org_id=org_id, patched_job_write_request=patched_job_write_request) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_partial_update_annotations: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **action** | **str**| | - **id** | **int**| A unique integer value identifying this job. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **patched_job_write_request** | [**PatchedJobWriteRequest**](PatchedJobWriteRequest.md)| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | No response body | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **jobs_partial_update_annotations_file** -> jobs_partial_update_annotations_file(file_id, id) - -Allows to upload an annotation file chunk. Implements TUS file uploading protocol. - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import jobs_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = jobs_api.JobsApi(api_client) - file_id = "bf325375-e030-fccb-a009-17317c574773" # str | - id = 1 # int | A unique integer value identifying this job. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - body = open('/path/to/file', 'rb') # file_type | (optional) - - # example passing only required values which don't have defaults set - try: - # Allows to upload an annotation file chunk. Implements TUS file uploading protocol. - api_instance.jobs_partial_update_annotations_file(file_id, id) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_partial_update_annotations_file: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Allows to upload an annotation file chunk. Implements TUS file uploading protocol. - api_instance.jobs_partial_update_annotations_file(file_id, id, x_organization=x_organization, org=org, org_id=org_id, body=body) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_partial_update_annotations_file: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file_id** | **str**| | - **id** | **int**| A unique integer value identifying this job. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **body** | **file_type**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: Not defined - - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **jobs_retrieve** -> JobRead jobs_retrieve(id) - -Method returns details of a job - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import jobs_api -from cvat_sdk.model.job_read import JobRead -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = jobs_api.JobsApi(api_client) - id = 1 # int | A unique integer value identifying this job. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method returns details of a job - api_response = api_instance.jobs_retrieve(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_retrieve: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns details of a job - api_response = api_instance.jobs_retrieve(id, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_retrieve: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this job. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**JobRead**](JobRead.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **jobs_retrieve_annotations** -> LabeledData jobs_retrieve_annotations(id) - -Method returns annotations for a specific job - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import jobs_api -from cvat_sdk.model.labeled_data import LabeledData -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = jobs_api.JobsApi(api_client) - id = 1 # int | A unique integer value identifying this job. - x_organization = "X-Organization_example" # str | (optional) - action = "download" # str | Used to start downloading process after annotation file had been created (optional) if omitted the server will use the default value of "download" - cloud_storage_id = 3.14 # float | Storage id (optional) - filename = "filename_example" # str | Desired output file name (optional) - format = "format_example" # str | Desired output format name You can get the list of supported formats at: /server/annotation/formats (optional) - location = "cloud_storage" # str | Where need to save downloaded annotation (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - use_default_location = True # bool | Use the location that was configured in the task to export annotation (optional) if omitted the server will use the default value of True - - # example passing only required values which don't have defaults set - try: - # Method returns annotations for a specific job - api_response = api_instance.jobs_retrieve_annotations(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_retrieve_annotations: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns annotations for a specific job - api_response = api_instance.jobs_retrieve_annotations(id, x_organization=x_organization, action=action, cloud_storage_id=cloud_storage_id, filename=filename, format=format, location=location, org=org, org_id=org_id, use_default_location=use_default_location) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_retrieve_annotations: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this job. | - **x_organization** | **str**| | [optional] - **action** | **str**| Used to start downloading process after annotation file had been created | [optional] if omitted the server will use the default value of "download" - **cloud_storage_id** | **float**| Storage id | [optional] - **filename** | **str**| Desired output file name | [optional] - **format** | **str**| Desired output format name You can get the list of supported formats at: /server/annotation/formats | [optional] - **location** | **str**| Where need to save downloaded annotation | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **use_default_location** | **bool**| Use the location that was configured in the task to export annotation | [optional] if omitted the server will use the default value of True - -### Return type - -[**LabeledData**](LabeledData.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | -**201** | Output file is ready for downloading | - | -**202** | Exporting has been started | - | -**405** | Format is not available | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **jobs_retrieve_data** -> jobs_retrieve_data(id, number, quality, type) - -Method returns data for a specific job - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import jobs_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = jobs_api.JobsApi(api_client) - id = 1 # int | A unique integer value identifying this job. - number = 3.14 # float | A unique number value identifying chunk or frame, doesn't matter for 'preview' type - quality = "compressed" # str | Specifies the quality level of the requested data, doesn't matter for 'preview' type - type = "chunk" # str | Specifies the type of the requested data - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method returns data for a specific job - api_instance.jobs_retrieve_data(id, number, quality, type) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_retrieve_data: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns data for a specific job - api_instance.jobs_retrieve_data(id, number, quality, type, x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_retrieve_data: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this job. | - **number** | **float**| A unique number value identifying chunk or frame, doesn't matter for 'preview' type | - **quality** | **str**| Specifies the quality level of the requested data, doesn't matter for 'preview' type | - **type** | **str**| Specifies the type of the requested data | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Data of a specific type | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **jobs_retrieve_data_meta** -> DataMetaRead jobs_retrieve_data_meta(id) - -Method provides a meta information about media files which are related with the job - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import jobs_api -from cvat_sdk.model.data_meta_read import DataMetaRead -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = jobs_api.JobsApi(api_client) - id = 1 # int | A unique integer value identifying this job. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method provides a meta information about media files which are related with the job - api_response = api_instance.jobs_retrieve_data_meta(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_retrieve_data_meta: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method provides a meta information about media files which are related with the job - api_response = api_instance.jobs_retrieve_data_meta(id, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_retrieve_data_meta: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this job. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**DataMetaRead**](DataMetaRead.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **jobs_retrieve_dataset** -> jobs_retrieve_dataset(format, id) - -Export job as a dataset in a specific format - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import jobs_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = jobs_api.JobsApi(api_client) - format = "format_example" # str | Desired output format name You can get the list of supported formats at: /server/annotation/formats - id = 1 # int | A unique integer value identifying this job. - x_organization = "X-Organization_example" # str | (optional) - action = "download" # str | Used to start downloading process after annotation file had been created (optional) if omitted the server will use the default value of "download" - cloud_storage_id = 3.14 # float | Storage id (optional) - filename = "filename_example" # str | Desired output file name (optional) - location = "cloud_storage" # str | Where need to save downloaded dataset (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - use_default_location = True # bool | Use the location that was configured in the task to export dataset (optional) if omitted the server will use the default value of True - - # example passing only required values which don't have defaults set - try: - # Export job as a dataset in a specific format - api_instance.jobs_retrieve_dataset(format, id) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_retrieve_dataset: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Export job as a dataset in a specific format - api_instance.jobs_retrieve_dataset(format, id, x_organization=x_organization, action=action, cloud_storage_id=cloud_storage_id, filename=filename, location=location, org=org, org_id=org_id, use_default_location=use_default_location) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_retrieve_dataset: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **format** | **str**| Desired output format name You can get the list of supported formats at: /server/annotation/formats | - **id** | **int**| A unique integer value identifying this job. | - **x_organization** | **str**| | [optional] - **action** | **str**| Used to start downloading process after annotation file had been created | [optional] if omitted the server will use the default value of "download" - **cloud_storage_id** | **float**| Storage id | [optional] - **filename** | **str**| Desired output file name | [optional] - **location** | **str**| Where need to save downloaded dataset | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **use_default_location** | **bool**| Use the location that was configured in the task to export dataset | [optional] if omitted the server will use the default value of True - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Download of file started | - | -**201** | Output file is ready for downloading | - | -**202** | Exporting has been started | - | -**405** | Format is not available | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **jobs_update** -> JobWrite jobs_update(id) - -Method updates a job by id - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import jobs_api -from cvat_sdk.model.job_write import JobWrite -from cvat_sdk.model.job_write_request import JobWriteRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = jobs_api.JobsApi(api_client) - id = 1 # int | A unique integer value identifying this job. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - job_write_request = JobWriteRequest( - assignee=1, - stage=JobStage("annotation"), - state=OperationStatus("new"), - ) # JobWriteRequest | (optional) - - # example passing only required values which don't have defaults set - try: - # Method updates a job by id - api_response = api_instance.jobs_update(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_update: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method updates a job by id - api_response = api_instance.jobs_update(id, x_organization=x_organization, org=org, org_id=org_id, job_write_request=job_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_update: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this job. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **job_write_request** | [**JobWriteRequest**](JobWriteRequest.md)| | [optional] - -### Return type - -[**JobWrite**](JobWrite.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **jobs_update_annotations** -> jobs_update_annotations(id, annotation_file_request) - -Method performs an update of all annotations in a specific job - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import jobs_api -from cvat_sdk.model.annotation_file_request import AnnotationFileRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = jobs_api.JobsApi(api_client) - id = 1 # int | A unique integer value identifying this job. - annotation_file_request = AnnotationFileRequest( - annotation_file=open('/path/to/file', 'rb'), - ) # AnnotationFileRequest | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method performs an update of all annotations in a specific job - api_instance.jobs_update_annotations(id, annotation_file_request) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_update_annotations: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method performs an update of all annotations in a specific job - api_instance.jobs_update_annotations(id, annotation_file_request, x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling JobsApi->jobs_update_annotations: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this job. | - **annotation_file_request** | [**AnnotationFileRequest**](AnnotationFileRequest.md)| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | Uploading has finished | - | -**202** | Uploading has been started | - | -**405** | Format is not available | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/cvat-sdk/docs/Label.md b/cvat-sdk/docs/Label.md deleted file mode 100644 index c2b3b353..00000000 --- a/cvat-sdk/docs/Label.md +++ /dev/null @@ -1,16 +0,0 @@ -# Label - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | -**id** | **int** | | [optional] -**color** | **str** | | [optional] -**attributes** | [**[Attribute]**](Attribute.md) | | [optional] if omitted the server will use the default value of [] -**deleted** | **bool** | Delete label if value is true from proper Task/Project object | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/LabeledData.md b/cvat-sdk/docs/LabeledData.md deleted file mode 100644 index 8330bf6c..00000000 --- a/cvat-sdk/docs/LabeledData.md +++ /dev/null @@ -1,15 +0,0 @@ -# LabeledData - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**version** | **int** | | -**tags** | [**[LabeledImage]**](LabeledImage.md) | | -**shapes** | [**[LabeledShape]**](LabeledShape.md) | | -**tracks** | [**[LabeledTrack]**](LabeledTrack.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/LabeledImage.md b/cvat-sdk/docs/LabeledImage.md deleted file mode 100644 index ada5b7f3..00000000 --- a/cvat-sdk/docs/LabeledImage.md +++ /dev/null @@ -1,17 +0,0 @@ -# LabeledImage - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**frame** | **int** | | -**label_id** | **int** | | -**group** | **int, none_type** | | -**attributes** | [**[AttributeVal]**](AttributeVal.md) | | -**id** | **int, none_type** | | [optional] -**source** | **str** | | [optional] if omitted the server will use the default value of "manual" -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/LabeledShape.md b/cvat-sdk/docs/LabeledShape.md deleted file mode 100644 index d799f581..00000000 --- a/cvat-sdk/docs/LabeledShape.md +++ /dev/null @@ -1,22 +0,0 @@ -# LabeledShape - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | [**ShapeType**](ShapeType.md) | | -**occluded** | **bool** | | -**points** | **[float]** | | -**frame** | **int** | | -**label_id** | **int** | | -**group** | **int, none_type** | | -**attributes** | [**[AttributeVal]**](AttributeVal.md) | | -**z_order** | **int** | | [optional] if omitted the server will use the default value of 0 -**rotation** | **float** | | [optional] if omitted the server will use the default value of 0.0 -**id** | **int, none_type** | | [optional] -**source** | **str** | | [optional] if omitted the server will use the default value of "manual" -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/LabeledTrack.md b/cvat-sdk/docs/LabeledTrack.md deleted file mode 100644 index 3034cbb9..00000000 --- a/cvat-sdk/docs/LabeledTrack.md +++ /dev/null @@ -1,18 +0,0 @@ -# LabeledTrack - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**frame** | **int** | | -**label_id** | **int** | | -**group** | **int, none_type** | | -**shapes** | [**[TrackedShape]**](TrackedShape.md) | | -**attributes** | [**[AttributeVal]**](AttributeVal.md) | | -**id** | **int, none_type** | | [optional] -**source** | **str** | | [optional] if omitted the server will use the default value of "manual" -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/LambdaApi.md b/cvat-sdk/docs/LambdaApi.md deleted file mode 100644 index e54ec312..00000000 --- a/cvat-sdk/docs/LambdaApi.md +++ /dev/null @@ -1,641 +0,0 @@ -# cvat_sdk.LambdaApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**lambda_create_functions**](LambdaApi.md#lambda_create_functions) | **POST** /api/lambda/functions/{func_id} | -[**lambda_create_requests**](LambdaApi.md#lambda_create_requests) | **POST** /api/lambda/requests | Method calls the function -[**lambda_list_functions**](LambdaApi.md#lambda_list_functions) | **GET** /api/lambda/functions | Method returns a list of functions -[**lambda_list_requests**](LambdaApi.md#lambda_list_requests) | **GET** /api/lambda/requests | Method returns a list of requests -[**lambda_retrieve_functions**](LambdaApi.md#lambda_retrieve_functions) | **GET** /api/lambda/functions/{func_id} | Method returns the information about the function -[**lambda_retrieve_requests**](LambdaApi.md#lambda_retrieve_requests) | **GET** /api/lambda/requests/{id} | Method returns the status of the request - - -# **lambda_create_functions** -> lambda_create_functions(func_id) - - - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import lambda_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lambda_api.LambdaApi(api_client) - func_id = "2" # str | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - api_instance.lambda_create_functions(func_id) - except cvat_sdk.ApiException as e: - print("Exception when calling LambdaApi->lambda_create_functions: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_instance.lambda_create_functions(func_id, x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling LambdaApi->lambda_create_functions: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **func_id** | **str**| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | No response body | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **lambda_create_requests** -> lambda_create_requests() - -Method calls the function - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import lambda_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lambda_api.LambdaApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method calls the function - api_instance.lambda_create_requests(x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling LambdaApi->lambda_create_requests: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | No response body | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **lambda_list_functions** -> lambda_list_functions() - -Method returns a list of functions - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import lambda_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lambda_api.LambdaApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns a list of functions - api_instance.lambda_list_functions(x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling LambdaApi->lambda_list_functions: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | No response body | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **lambda_list_requests** -> lambda_list_requests() - -Method returns a list of requests - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import lambda_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lambda_api.LambdaApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns a list of requests - api_instance.lambda_list_requests(x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling LambdaApi->lambda_list_requests: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | No response body | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **lambda_retrieve_functions** -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} lambda_retrieve_functions(func_id) - -Method returns the information about the function - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import lambda_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lambda_api.LambdaApi(api_client) - func_id = "2" # str | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method returns the information about the function - api_response = api_instance.lambda_retrieve_functions(func_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling LambdaApi->lambda_retrieve_functions: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns the information about the function - api_response = api_instance.lambda_retrieve_functions(func_id, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling LambdaApi->lambda_retrieve_functions: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **func_id** | **str**| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -**{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Information about the function | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **lambda_retrieve_requests** -> lambda_retrieve_requests(id) - -Method returns the status of the request - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import lambda_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lambda_api.LambdaApi(api_client) - id = 1 # int | Request id - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method returns the status of the request - api_instance.lambda_retrieve_requests(id) - except cvat_sdk.ApiException as e: - print("Exception when calling LambdaApi->lambda_retrieve_requests: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns the status of the request - api_instance.lambda_retrieve_requests(id, x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling LambdaApi->lambda_retrieve_requests: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| Request id | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | No response body | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/cvat-sdk/docs/LocationEnum.md b/cvat-sdk/docs/LocationEnum.md deleted file mode 100644 index 91a9a873..00000000 --- a/cvat-sdk/docs/LocationEnum.md +++ /dev/null @@ -1,11 +0,0 @@ -# LocationEnum - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["cloud_storage", "local", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/LogEvent.md b/cvat-sdk/docs/LogEvent.md deleted file mode 100644 index da5def42..00000000 --- a/cvat-sdk/docs/LogEvent.md +++ /dev/null @@ -1,20 +0,0 @@ -# LogEvent - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client_id** | **int** | | -**name** | **str** | | -**time** | **datetime** | | -**is_active** | **bool** | | -**job_id** | **int** | | [optional] -**task_id** | **int** | | [optional] -**proj_id** | **int** | | [optional] -**message** | **str** | | [optional] -**payload** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/LogEventRequest.md b/cvat-sdk/docs/LogEventRequest.md deleted file mode 100644 index 9f053b8e..00000000 --- a/cvat-sdk/docs/LogEventRequest.md +++ /dev/null @@ -1,20 +0,0 @@ -# LogEventRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client_id** | **int** | | -**name** | **str** | | -**time** | **datetime** | | -**is_active** | **bool** | | -**job_id** | **int** | | [optional] -**task_id** | **int** | | [optional] -**proj_id** | **int** | | [optional] -**message** | **str** | | [optional] -**payload** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/LoginRequest.md b/cvat-sdk/docs/LoginRequest.md deleted file mode 100644 index 56fd9f4a..00000000 --- a/cvat-sdk/docs/LoginRequest.md +++ /dev/null @@ -1,14 +0,0 @@ -# LoginRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**password** | **str** | | -**username** | **str** | | [optional] -**email** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/Manifest.md b/cvat-sdk/docs/Manifest.md deleted file mode 100644 index 08792b7d..00000000 --- a/cvat-sdk/docs/Manifest.md +++ /dev/null @@ -1,12 +0,0 @@ -# Manifest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**filename** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/ManifestRequest.md b/cvat-sdk/docs/ManifestRequest.md deleted file mode 100644 index 6c5f1c20..00000000 --- a/cvat-sdk/docs/ManifestRequest.md +++ /dev/null @@ -1,12 +0,0 @@ -# ManifestRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**filename** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/MembershipRead.md b/cvat-sdk/docs/MembershipRead.md deleted file mode 100644 index 3ddacb29..00000000 --- a/cvat-sdk/docs/MembershipRead.md +++ /dev/null @@ -1,18 +0,0 @@ -# MembershipRead - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**user** | [**BasicUser**](BasicUser.md) | | -**id** | **int** | | [optional] [readonly] -**organization** | **int** | | [optional] [readonly] -**is_active** | **bool** | | [optional] [readonly] -**joined_date** | **datetime** | | [optional] [readonly] -**role** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] [readonly] -**invitation** | **str** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/MembershipWrite.md b/cvat-sdk/docs/MembershipWrite.md deleted file mode 100644 index 5ff60c70..00000000 --- a/cvat-sdk/docs/MembershipWrite.md +++ /dev/null @@ -1,17 +0,0 @@ -# MembershipWrite - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**role** | [**RoleEnum**](RoleEnum.md) | | -**id** | **int** | | [optional] [readonly] -**user** | **int** | | [optional] [readonly] -**organization** | **int** | | [optional] [readonly] -**is_active** | **bool** | | [optional] [readonly] -**joined_date** | **datetime** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/MembershipsApi.md b/cvat-sdk/docs/MembershipsApi.md deleted file mode 100644 index fae8eb73..00000000 --- a/cvat-sdk/docs/MembershipsApi.md +++ /dev/null @@ -1,462 +0,0 @@ -# cvat_sdk.MembershipsApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**memberships_destroy**](MembershipsApi.md#memberships_destroy) | **DELETE** /api/memberships/{id} | Method deletes a membership -[**memberships_list**](MembershipsApi.md#memberships_list) | **GET** /api/memberships | Method returns a paginated list of memberships according to query parameters -[**memberships_partial_update**](MembershipsApi.md#memberships_partial_update) | **PATCH** /api/memberships/{id} | Methods does a partial update of chosen fields in a membership -[**memberships_retrieve**](MembershipsApi.md#memberships_retrieve) | **GET** /api/memberships/{id} | Method returns details of a membership - - -# **memberships_destroy** -> memberships_destroy(id) - -Method deletes a membership - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import memberships_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = memberships_api.MembershipsApi(api_client) - id = 1 # int | A unique integer value identifying this membership. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method deletes a membership - api_instance.memberships_destroy(id) - except cvat_sdk.ApiException as e: - print("Exception when calling MembershipsApi->memberships_destroy: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method deletes a membership - api_instance.memberships_destroy(id, x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling MembershipsApi->memberships_destroy: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this membership. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | The membership has been deleted | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **memberships_list** -> PaginatedMembershipReadList memberships_list() - -Method returns a paginated list of memberships according to query parameters - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import memberships_api -from cvat_sdk.model.paginated_membership_read_list import PaginatedMembershipReadList -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = memberships_api.MembershipsApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - filter = "filter_example" # str | A filter term. Avaliable filter_fields: ['user_name', 'role', 'id', 'user'] (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - page = 1 # int | A page number within the paginated result set. (optional) - page_size = 1 # int | Number of results to return per page. (optional) - search = "search_example" # str | A search term. Avaliable search_fields: ('user_name', 'role') (optional) - sort = "sort_example" # str | Which field to use when ordering the results. Avaliable ordering_fields: ['user_name', 'role', 'id', 'user'] (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns a paginated list of memberships according to query parameters - api_response = api_instance.memberships_list(x_organization=x_organization, filter=filter, org=org, org_id=org_id, page=page, page_size=page_size, search=search, sort=sort) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling MembershipsApi->memberships_list: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **filter** | **str**| A filter term. Avaliable filter_fields: ['user_name', 'role', 'id', 'user'] | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **page** | **int**| A page number within the paginated result set. | [optional] - **page_size** | **int**| Number of results to return per page. | [optional] - **search** | **str**| A search term. Avaliable search_fields: ('user_name', 'role') | [optional] - **sort** | **str**| Which field to use when ordering the results. Avaliable ordering_fields: ['user_name', 'role', 'id', 'user'] | [optional] - -### Return type - -[**PaginatedMembershipReadList**](PaginatedMembershipReadList.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **memberships_partial_update** -> MembershipWrite memberships_partial_update(id) - -Methods does a partial update of chosen fields in a membership - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import memberships_api -from cvat_sdk.model.patched_membership_write_request import PatchedMembershipWriteRequest -from cvat_sdk.model.membership_write import MembershipWrite -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = memberships_api.MembershipsApi(api_client) - id = 1 # int | A unique integer value identifying this membership. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - patched_membership_write_request = PatchedMembershipWriteRequest( - role=RoleEnum("worker"), - ) # PatchedMembershipWriteRequest | (optional) - - # example passing only required values which don't have defaults set - try: - # Methods does a partial update of chosen fields in a membership - api_response = api_instance.memberships_partial_update(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling MembershipsApi->memberships_partial_update: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Methods does a partial update of chosen fields in a membership - api_response = api_instance.memberships_partial_update(id, x_organization=x_organization, org=org, org_id=org_id, patched_membership_write_request=patched_membership_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling MembershipsApi->memberships_partial_update: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this membership. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **patched_membership_write_request** | [**PatchedMembershipWriteRequest**](PatchedMembershipWriteRequest.md)| | [optional] - -### Return type - -[**MembershipWrite**](MembershipWrite.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **memberships_retrieve** -> MembershipRead memberships_retrieve(id) - -Method returns details of a membership - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import memberships_api -from cvat_sdk.model.membership_read import MembershipRead -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = memberships_api.MembershipsApi(api_client) - id = 1 # int | A unique integer value identifying this membership. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method returns details of a membership - api_response = api_instance.memberships_retrieve(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling MembershipsApi->memberships_retrieve: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns details of a membership - api_response = api_instance.memberships_retrieve(id, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling MembershipsApi->memberships_retrieve: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this membership. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**MembershipRead**](MembershipRead.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/cvat-sdk/docs/MetaUser.md b/cvat-sdk/docs/MetaUser.md deleted file mode 100644 index 0d1c59ab..00000000 --- a/cvat-sdk/docs/MetaUser.md +++ /dev/null @@ -1,23 +0,0 @@ -# MetaUser - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | **str** | Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. | -**url** | **str** | | [optional] [readonly] -**id** | **int** | | [optional] [readonly] -**first_name** | **str** | | [optional] -**last_name** | **str** | | [optional] -**email** | **str** | | [optional] -**is_staff** | **bool** | Designates whether the user can log into this admin site. | [optional] -**is_superuser** | **bool** | Designates that this user has all permissions without explicitly assigning them. | [optional] -**is_active** | **bool** | Designates whether this user should be treated as active. Unselect this instead of deleting accounts. | [optional] -**last_login** | **datetime** | | [optional] [readonly] -**date_joined** | **datetime** | | [optional] [readonly] -**groups** | **[str]** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/OperationStatus.md b/cvat-sdk/docs/OperationStatus.md deleted file mode 100644 index 58deed54..00000000 --- a/cvat-sdk/docs/OperationStatus.md +++ /dev/null @@ -1,11 +0,0 @@ -# OperationStatus - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["new", "in progress", "completed", "rejected", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/OrganizationRead.md b/cvat-sdk/docs/OrganizationRead.md deleted file mode 100644 index a7227a7e..00000000 --- a/cvat-sdk/docs/OrganizationRead.md +++ /dev/null @@ -1,19 +0,0 @@ -# OrganizationRead - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**owner** | [**BasicUser**](BasicUser.md) | | -**id** | **int** | | [optional] [readonly] -**slug** | **str** | | [optional] [readonly] -**name** | **str** | | [optional] [readonly] -**description** | **str** | | [optional] [readonly] -**created_date** | **datetime** | | [optional] [readonly] -**updated_date** | **datetime** | | [optional] [readonly] -**contact** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/OrganizationWrite.md b/cvat-sdk/docs/OrganizationWrite.md deleted file mode 100644 index 9b10e8ad..00000000 --- a/cvat-sdk/docs/OrganizationWrite.md +++ /dev/null @@ -1,19 +0,0 @@ -# OrganizationWrite - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**slug** | **str** | | -**id** | **int** | | [optional] [readonly] -**name** | **str** | | [optional] -**description** | **str** | | [optional] -**created_date** | **datetime** | | [optional] [readonly] -**updated_date** | **datetime** | | [optional] [readonly] -**contact** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] -**owner** | **int** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/OrganizationWriteRequest.md b/cvat-sdk/docs/OrganizationWriteRequest.md deleted file mode 100644 index 2fbc9139..00000000 --- a/cvat-sdk/docs/OrganizationWriteRequest.md +++ /dev/null @@ -1,15 +0,0 @@ -# OrganizationWriteRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**slug** | **str** | | -**name** | **str** | | [optional] -**description** | **str** | | [optional] -**contact** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/OrganizationsApi.md b/cvat-sdk/docs/OrganizationsApi.md deleted file mode 100644 index 62e031e2..00000000 --- a/cvat-sdk/docs/OrganizationsApi.md +++ /dev/null @@ -1,584 +0,0 @@ -# cvat_sdk.OrganizationsApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**organizations_create**](OrganizationsApi.md#organizations_create) | **POST** /api/organizations | Method creates an organization -[**organizations_destroy**](OrganizationsApi.md#organizations_destroy) | **DELETE** /api/organizations/{id} | Method deletes an organization -[**organizations_list**](OrganizationsApi.md#organizations_list) | **GET** /api/organizations | Method returns a paginated list of organizatins according to query parameters -[**organizations_partial_update**](OrganizationsApi.md#organizations_partial_update) | **PATCH** /api/organizations/{id} | Methods does a partial update of chosen fields in an organization -[**organizations_retrieve**](OrganizationsApi.md#organizations_retrieve) | **GET** /api/organizations/{id} | Method returns details of an organization - - -# **organizations_create** -> OrganizationWrite organizations_create(organization_write_request) - -Method creates an organization - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import organizations_api -from cvat_sdk.model.organization_write import OrganizationWrite -from cvat_sdk.model.organization_write_request import OrganizationWriteRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = organizations_api.OrganizationsApi(api_client) - organization_write_request = OrganizationWriteRequest( - slug="z", - name="name_example", - description="description_example", - contact={ - "key": None, - }, - ) # OrganizationWriteRequest | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method creates an organization - api_response = api_instance.organizations_create(organization_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling OrganizationsApi->organizations_create: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method creates an organization - api_response = api_instance.organizations_create(organization_write_request, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling OrganizationsApi->organizations_create: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **organization_write_request** | [**OrganizationWriteRequest**](OrganizationWriteRequest.md)| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**OrganizationWrite**](OrganizationWrite.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **organizations_destroy** -> organizations_destroy(id) - -Method deletes an organization - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import organizations_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = organizations_api.OrganizationsApi(api_client) - id = 1 # int | A unique integer value identifying this organization. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method deletes an organization - api_instance.organizations_destroy(id) - except cvat_sdk.ApiException as e: - print("Exception when calling OrganizationsApi->organizations_destroy: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method deletes an organization - api_instance.organizations_destroy(id, x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling OrganizationsApi->organizations_destroy: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this organization. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | The organization has been deleted | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **organizations_list** -> [OrganizationRead] organizations_list() - -Method returns a paginated list of organizatins according to query parameters - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import organizations_api -from cvat_sdk.model.organization_read import OrganizationRead -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = organizations_api.OrganizationsApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - filter = "filter_example" # str | A filter term. Avaliable filter_fields: ['name', 'owner', 'id', 'slug'] (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - search = "search_example" # str | A search term. Avaliable search_fields: ('name', 'owner') (optional) - sort = "sort_example" # str | Which field to use when ordering the results. Avaliable ordering_fields: ['name', 'owner', 'id', 'slug'] (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns a paginated list of organizatins according to query parameters - api_response = api_instance.organizations_list(x_organization=x_organization, filter=filter, org=org, org_id=org_id, search=search, sort=sort) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling OrganizationsApi->organizations_list: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **filter** | **str**| A filter term. Avaliable filter_fields: ['name', 'owner', 'id', 'slug'] | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **search** | **str**| A search term. Avaliable search_fields: ('name', 'owner') | [optional] - **sort** | **str**| Which field to use when ordering the results. Avaliable ordering_fields: ['name', 'owner', 'id', 'slug'] | [optional] - -### Return type - -[**[OrganizationRead]**](OrganizationRead.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **organizations_partial_update** -> OrganizationWrite organizations_partial_update(id) - -Methods does a partial update of chosen fields in an organization - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import organizations_api -from cvat_sdk.model.patched_organization_write_request import PatchedOrganizationWriteRequest -from cvat_sdk.model.organization_write import OrganizationWrite -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = organizations_api.OrganizationsApi(api_client) - id = 1 # int | A unique integer value identifying this organization. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - patched_organization_write_request = PatchedOrganizationWriteRequest( - slug="z", - name="name_example", - description="description_example", - contact={ - "key": None, - }, - ) # PatchedOrganizationWriteRequest | (optional) - - # example passing only required values which don't have defaults set - try: - # Methods does a partial update of chosen fields in an organization - api_response = api_instance.organizations_partial_update(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling OrganizationsApi->organizations_partial_update: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Methods does a partial update of chosen fields in an organization - api_response = api_instance.organizations_partial_update(id, x_organization=x_organization, org=org, org_id=org_id, patched_organization_write_request=patched_organization_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling OrganizationsApi->organizations_partial_update: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this organization. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **patched_organization_write_request** | [**PatchedOrganizationWriteRequest**](PatchedOrganizationWriteRequest.md)| | [optional] - -### Return type - -[**OrganizationWrite**](OrganizationWrite.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **organizations_retrieve** -> OrganizationRead organizations_retrieve(id) - -Method returns details of an organization - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import organizations_api -from cvat_sdk.model.organization_read import OrganizationRead -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = organizations_api.OrganizationsApi(api_client) - id = 1 # int | A unique integer value identifying this organization. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method returns details of an organization - api_response = api_instance.organizations_retrieve(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling OrganizationsApi->organizations_retrieve: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns details of an organization - api_response = api_instance.organizations_retrieve(id, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling OrganizationsApi->organizations_retrieve: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this organization. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**OrganizationRead**](OrganizationRead.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/cvat-sdk/docs/PaginatedCloudStorageReadList.md b/cvat-sdk/docs/PaginatedCloudStorageReadList.md deleted file mode 100644 index c6bfddea..00000000 --- a/cvat-sdk/docs/PaginatedCloudStorageReadList.md +++ /dev/null @@ -1,15 +0,0 @@ -# PaginatedCloudStorageReadList - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **int** | | [optional] -**next** | **str, none_type** | | [optional] -**previous** | **str, none_type** | | [optional] -**results** | [**[CloudStorageRead]**](CloudStorageRead.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PaginatedCommentReadList.md b/cvat-sdk/docs/PaginatedCommentReadList.md deleted file mode 100644 index d308eee9..00000000 --- a/cvat-sdk/docs/PaginatedCommentReadList.md +++ /dev/null @@ -1,15 +0,0 @@ -# PaginatedCommentReadList - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **int** | | [optional] -**next** | **str, none_type** | | [optional] -**previous** | **str, none_type** | | [optional] -**results** | [**[CommentRead]**](CommentRead.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PaginatedInvitationReadList.md b/cvat-sdk/docs/PaginatedInvitationReadList.md deleted file mode 100644 index e5066889..00000000 --- a/cvat-sdk/docs/PaginatedInvitationReadList.md +++ /dev/null @@ -1,15 +0,0 @@ -# PaginatedInvitationReadList - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **int** | | [optional] -**next** | **str, none_type** | | [optional] -**previous** | **str, none_type** | | [optional] -**results** | [**[InvitationRead]**](InvitationRead.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PaginatedIssueReadList.md b/cvat-sdk/docs/PaginatedIssueReadList.md deleted file mode 100644 index ce7bcbb5..00000000 --- a/cvat-sdk/docs/PaginatedIssueReadList.md +++ /dev/null @@ -1,15 +0,0 @@ -# PaginatedIssueReadList - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **int** | | [optional] -**next** | **str, none_type** | | [optional] -**previous** | **str, none_type** | | [optional] -**results** | [**[IssueRead]**](IssueRead.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PaginatedJobCommitList.md b/cvat-sdk/docs/PaginatedJobCommitList.md deleted file mode 100644 index f148ef33..00000000 --- a/cvat-sdk/docs/PaginatedJobCommitList.md +++ /dev/null @@ -1,15 +0,0 @@ -# PaginatedJobCommitList - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **int** | | [optional] -**next** | **str, none_type** | | [optional] -**previous** | **str, none_type** | | [optional] -**results** | [**[JobCommit]**](JobCommit.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PaginatedJobReadList.md b/cvat-sdk/docs/PaginatedJobReadList.md deleted file mode 100644 index 989042bd..00000000 --- a/cvat-sdk/docs/PaginatedJobReadList.md +++ /dev/null @@ -1,15 +0,0 @@ -# PaginatedJobReadList - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **int** | | [optional] -**next** | **str, none_type** | | [optional] -**previous** | **str, none_type** | | [optional] -**results** | [**[JobRead]**](JobRead.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PaginatedMembershipReadList.md b/cvat-sdk/docs/PaginatedMembershipReadList.md deleted file mode 100644 index 1b72049b..00000000 --- a/cvat-sdk/docs/PaginatedMembershipReadList.md +++ /dev/null @@ -1,15 +0,0 @@ -# PaginatedMembershipReadList - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **int** | | [optional] -**next** | **str, none_type** | | [optional] -**previous** | **str, none_type** | | [optional] -**results** | [**[MembershipRead]**](MembershipRead.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PaginatedMetaUserList.md b/cvat-sdk/docs/PaginatedMetaUserList.md deleted file mode 100644 index 6d5ed59f..00000000 --- a/cvat-sdk/docs/PaginatedMetaUserList.md +++ /dev/null @@ -1,15 +0,0 @@ -# PaginatedMetaUserList - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **int** | | [optional] -**next** | **str, none_type** | | [optional] -**previous** | **str, none_type** | | [optional] -**results** | [**[MetaUser]**](MetaUser.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PaginatedPolymorphicProjectList.md b/cvat-sdk/docs/PaginatedPolymorphicProjectList.md deleted file mode 100644 index eca0eb25..00000000 --- a/cvat-sdk/docs/PaginatedPolymorphicProjectList.md +++ /dev/null @@ -1,15 +0,0 @@ -# PaginatedPolymorphicProjectList - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **int** | | [optional] -**next** | **str, none_type** | | [optional] -**previous** | **str, none_type** | | [optional] -**results** | [**[PolymorphicProject]**](PolymorphicProject.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PaginatedTaskReadList.md b/cvat-sdk/docs/PaginatedTaskReadList.md deleted file mode 100644 index 84bfc094..00000000 --- a/cvat-sdk/docs/PaginatedTaskReadList.md +++ /dev/null @@ -1,15 +0,0 @@ -# PaginatedTaskReadList - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **int** | | [optional] -**next** | **str, none_type** | | [optional] -**previous** | **str, none_type** | | [optional] -**results** | [**[TaskRead]**](TaskRead.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PasswordChangeRequest.md b/cvat-sdk/docs/PasswordChangeRequest.md deleted file mode 100644 index c229caba..00000000 --- a/cvat-sdk/docs/PasswordChangeRequest.md +++ /dev/null @@ -1,14 +0,0 @@ -# PasswordChangeRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**old_password** | **str** | | -**new_password1** | **str** | | -**new_password2** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PasswordResetConfirmRequest.md b/cvat-sdk/docs/PasswordResetConfirmRequest.md deleted file mode 100644 index 0924a95a..00000000 --- a/cvat-sdk/docs/PasswordResetConfirmRequest.md +++ /dev/null @@ -1,16 +0,0 @@ -# PasswordResetConfirmRequest - -Serializer for confirming a password reset attempt. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**new_password1** | **str** | | -**new_password2** | **str** | | -**uid** | **str** | | -**token** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PasswordResetSerializerExRequest.md b/cvat-sdk/docs/PasswordResetSerializerExRequest.md deleted file mode 100644 index 54100202..00000000 --- a/cvat-sdk/docs/PasswordResetSerializerExRequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# PasswordResetSerializerExRequest - -Serializer for requesting a password reset e-mail. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PatchedCloudStorageWriteRequest.md b/cvat-sdk/docs/PatchedCloudStorageWriteRequest.md deleted file mode 100644 index f7137c1a..00000000 --- a/cvat-sdk/docs/PatchedCloudStorageWriteRequest.md +++ /dev/null @@ -1,24 +0,0 @@ -# PatchedCloudStorageWriteRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**provider_type** | [**ProviderTypeEnum**](ProviderTypeEnum.md) | | [optional] -**resource** | **str** | | [optional] -**display_name** | **str** | | [optional] -**owner** | [**BasicUserRequest**](BasicUserRequest.md) | | [optional] -**credentials_type** | [**CredentialsTypeEnum**](CredentialsTypeEnum.md) | | [optional] -**session_token** | **str** | | [optional] -**account_name** | **str** | | [optional] -**key** | **str** | | [optional] -**secret_key** | **str** | | [optional] -**key_file** | **file_type** | | [optional] -**specific_attributes** | **str** | | [optional] -**description** | **str** | | [optional] -**manifests** | [**[ManifestRequest]**](ManifestRequest.md) | | [optional] if omitted the server will use the default value of [] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PatchedCommentWriteRequest.md b/cvat-sdk/docs/PatchedCommentWriteRequest.md deleted file mode 100644 index 7bb2f146..00000000 --- a/cvat-sdk/docs/PatchedCommentWriteRequest.md +++ /dev/null @@ -1,14 +0,0 @@ -# PatchedCommentWriteRequest - -Adds support for write once fields to serializers. To use it, specify a list of fields as `write_once_fields` on the serializer's Meta: ``` class Meta: model = SomeModel fields = '__all__' write_once_fields = ('collection', ) ``` Now the fields in `write_once_fields` can be set during POST (create), but cannot be changed afterwards via PUT or PATCH (update). Inspired by http://stackoverflow.com/a/37487134/627411. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**issue** | **int** | | [optional] -**message** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PatchedInvitationWriteRequest.md b/cvat-sdk/docs/PatchedInvitationWriteRequest.md deleted file mode 100644 index 36ce92ed..00000000 --- a/cvat-sdk/docs/PatchedInvitationWriteRequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# PatchedInvitationWriteRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**role** | [**RoleEnum**](RoleEnum.md) | | [optional] -**email** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PatchedIssueWriteRequest.md b/cvat-sdk/docs/PatchedIssueWriteRequest.md deleted file mode 100644 index fd447821..00000000 --- a/cvat-sdk/docs/PatchedIssueWriteRequest.md +++ /dev/null @@ -1,18 +0,0 @@ -# PatchedIssueWriteRequest - -Adds support for write once fields to serializers. To use it, specify a list of fields as `write_once_fields` on the serializer's Meta: ``` class Meta: model = SomeModel fields = '__all__' write_once_fields = ('collection', ) ``` Now the fields in `write_once_fields` can be set during POST (create), but cannot be changed afterwards via PUT or PATCH (update). Inspired by http://stackoverflow.com/a/37487134/627411. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**frame** | **int** | | [optional] -**position** | **[float]** | | [optional] -**job** | **int** | | [optional] -**assignee** | **int, none_type** | | [optional] -**message** | **str** | | [optional] -**resolved** | **bool** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PatchedJobWriteRequest.md b/cvat-sdk/docs/PatchedJobWriteRequest.md deleted file mode 100644 index a10cde5a..00000000 --- a/cvat-sdk/docs/PatchedJobWriteRequest.md +++ /dev/null @@ -1,14 +0,0 @@ -# PatchedJobWriteRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**assignee** | **int, none_type** | | [optional] -**stage** | [**JobStage**](JobStage.md) | | [optional] -**state** | [**OperationStatus**](OperationStatus.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PatchedLabelRequest.md b/cvat-sdk/docs/PatchedLabelRequest.md deleted file mode 100644 index c14ee623..00000000 --- a/cvat-sdk/docs/PatchedLabelRequest.md +++ /dev/null @@ -1,16 +0,0 @@ -# PatchedLabelRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **str** | | [optional] -**color** | **str** | | [optional] -**attributes** | [**[AttributeRequest]**](AttributeRequest.md) | | [optional] if omitted the server will use the default value of [] -**deleted** | **bool** | Delete label if value is true from proper Task/Project object | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PatchedMembershipWriteRequest.md b/cvat-sdk/docs/PatchedMembershipWriteRequest.md deleted file mode 100644 index afd610dc..00000000 --- a/cvat-sdk/docs/PatchedMembershipWriteRequest.md +++ /dev/null @@ -1,12 +0,0 @@ -# PatchedMembershipWriteRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**role** | [**RoleEnum**](RoleEnum.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PatchedOrganizationWriteRequest.md b/cvat-sdk/docs/PatchedOrganizationWriteRequest.md deleted file mode 100644 index a172a997..00000000 --- a/cvat-sdk/docs/PatchedOrganizationWriteRequest.md +++ /dev/null @@ -1,15 +0,0 @@ -# PatchedOrganizationWriteRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**slug** | **str** | | [optional] -**name** | **str** | | [optional] -**description** | **str** | | [optional] -**contact** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PatchedProjectWriteRequest.md b/cvat-sdk/docs/PatchedProjectWriteRequest.md deleted file mode 100644 index b657a823..00000000 --- a/cvat-sdk/docs/PatchedProjectWriteRequest.md +++ /dev/null @@ -1,19 +0,0 @@ -# PatchedProjectWriteRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**labels** | [**[PatchedLabelRequest]**](PatchedLabelRequest.md) | | [optional] if omitted the server will use the default value of [] -**owner_id** | **int, none_type** | | [optional] -**assignee_id** | **int, none_type** | | [optional] -**bug_tracker** | **str** | | [optional] -**target_storage** | [**PatchedProjectWriteRequestTargetStorage**](PatchedProjectWriteRequestTargetStorage.md) | | [optional] -**source_storage** | [**PatchedProjectWriteRequestTargetStorage**](PatchedProjectWriteRequestTargetStorage.md) | | [optional] -**task_subsets** | **[str]** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PatchedProjectWriteRequestTargetStorage.md b/cvat-sdk/docs/PatchedProjectWriteRequestTargetStorage.md deleted file mode 100644 index eccb27e3..00000000 --- a/cvat-sdk/docs/PatchedProjectWriteRequestTargetStorage.md +++ /dev/null @@ -1,13 +0,0 @@ -# PatchedProjectWriteRequestTargetStorage - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**location** | [**LocationEnum**](LocationEnum.md) | | [optional] -**cloud_storage_id** | **int, none_type** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PatchedTaskWriteRequest.md b/cvat-sdk/docs/PatchedTaskWriteRequest.md deleted file mode 100644 index a3ea65cb..00000000 --- a/cvat-sdk/docs/PatchedTaskWriteRequest.md +++ /dev/null @@ -1,23 +0,0 @@ -# PatchedTaskWriteRequest - -Adds support for write once fields to serializers. To use it, specify a list of fields as `write_once_fields` on the serializer's Meta: ``` class Meta: model = SomeModel fields = '__all__' write_once_fields = ('collection', ) ``` Now the fields in `write_once_fields` can be set during POST (create), but cannot be changed afterwards via PUT or PATCH (update). Inspired by http://stackoverflow.com/a/37487134/627411. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**project_id** | **int, none_type** | | [optional] -**owner_id** | **int, none_type** | | [optional] -**assignee_id** | **int, none_type** | | [optional] -**bug_tracker** | **str** | | [optional] -**overlap** | **int, none_type** | | [optional] -**segment_size** | **int** | | [optional] -**labels** | [**[PatchedLabelRequest]**](PatchedLabelRequest.md) | | [optional] -**subset** | **str** | | [optional] -**target_storage** | [**PatchedTaskWriteRequestTargetStorage**](PatchedTaskWriteRequestTargetStorage.md) | | [optional] -**source_storage** | [**PatchedTaskWriteRequestTargetStorage**](PatchedTaskWriteRequestTargetStorage.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PatchedTaskWriteRequestTargetStorage.md b/cvat-sdk/docs/PatchedTaskWriteRequestTargetStorage.md deleted file mode 100644 index 045f1214..00000000 --- a/cvat-sdk/docs/PatchedTaskWriteRequestTargetStorage.md +++ /dev/null @@ -1,13 +0,0 @@ -# PatchedTaskWriteRequestTargetStorage - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**location** | [**LocationEnum**](LocationEnum.md) | | [optional] -**cloud_storage_id** | **int, none_type** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PatchedUserRequest.md b/cvat-sdk/docs/PatchedUserRequest.md deleted file mode 100644 index 346c8590..00000000 --- a/cvat-sdk/docs/PatchedUserRequest.md +++ /dev/null @@ -1,19 +0,0 @@ -# PatchedUserRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | **str** | Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. | [optional] -**first_name** | **str** | | [optional] -**last_name** | **str** | | [optional] -**email** | **str** | | [optional] -**groups** | **[str]** | | [optional] -**is_staff** | **bool** | Designates whether the user can log into this admin site. | [optional] -**is_superuser** | **bool** | Designates that this user has all permissions without explicitly assigning them. | [optional] -**is_active** | **bool** | Designates whether this user should be treated as active. Unselect this instead of deleting accounts. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/Plugins.md b/cvat-sdk/docs/Plugins.md deleted file mode 100644 index 217cce61..00000000 --- a/cvat-sdk/docs/Plugins.md +++ /dev/null @@ -1,15 +0,0 @@ -# Plugins - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**git_integration** | **bool** | | -**analytics** | **bool** | | -**models** | **bool** | | -**predict** | **bool** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/PolymorphicProject.md b/cvat-sdk/docs/PolymorphicProject.md deleted file mode 100644 index 7d46fd27..00000000 --- a/cvat-sdk/docs/PolymorphicProject.md +++ /dev/null @@ -1,27 +0,0 @@ -# PolymorphicProject - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [readonly] -**url** | **str** | | [optional] [readonly] -**id** | **int** | | [optional] [readonly] -**labels** | [**[Label]**](Label.md) | | [optional] [readonly] if omitted the server will use the default value of [] -**tasks** | **[int]** | | [optional] [readonly] -**owner** | [**ProjectReadOwner**](ProjectReadOwner.md) | | [optional] -**assignee** | [**ProjectReadAssignee**](ProjectReadAssignee.md) | | [optional] -**bug_tracker** | **str** | | [optional] -**task_subsets** | **[str]** | | [optional] [readonly] -**created_date** | **datetime** | | [optional] [readonly] -**updated_date** | **datetime** | | [optional] [readonly] -**status** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] [readonly] -**dimension** | **str, none_type** | | [optional] [readonly] -**organization** | **int, none_type** | | [optional] [readonly] -**target_storage** | [**ProjectReadTargetStorage**](ProjectReadTargetStorage.md) | | [optional] -**source_storage** | [**ProjectReadTargetStorage**](ProjectReadTargetStorage.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/ProjectFileRequest.md b/cvat-sdk/docs/ProjectFileRequest.md deleted file mode 100644 index 6f198e12..00000000 --- a/cvat-sdk/docs/ProjectFileRequest.md +++ /dev/null @@ -1,12 +0,0 @@ -# ProjectFileRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**project_file** | **file_type** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/ProjectRead.md b/cvat-sdk/docs/ProjectRead.md deleted file mode 100644 index 83be8f36..00000000 --- a/cvat-sdk/docs/ProjectRead.md +++ /dev/null @@ -1,27 +0,0 @@ -# ProjectRead - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | -**url** | **str** | | [optional] [readonly] -**id** | **int** | | [optional] [readonly] -**labels** | [**[Label]**](Label.md) | | [optional] [readonly] if omitted the server will use the default value of [] -**tasks** | **[int]** | | [optional] [readonly] -**owner** | [**ProjectReadOwner**](ProjectReadOwner.md) | | [optional] -**assignee** | [**ProjectReadAssignee**](ProjectReadAssignee.md) | | [optional] -**bug_tracker** | **str** | | [optional] -**task_subsets** | **[str]** | | [optional] [readonly] -**created_date** | **datetime** | | [optional] [readonly] -**updated_date** | **datetime** | | [optional] [readonly] -**status** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] [readonly] -**dimension** | **str, none_type** | | [optional] [readonly] -**organization** | **int, none_type** | | [optional] [readonly] -**target_storage** | [**ProjectReadTargetStorage**](ProjectReadTargetStorage.md) | | [optional] -**source_storage** | [**ProjectReadTargetStorage**](ProjectReadTargetStorage.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/ProjectReadAssignee.md b/cvat-sdk/docs/ProjectReadAssignee.md deleted file mode 100644 index e7c64871..00000000 --- a/cvat-sdk/docs/ProjectReadAssignee.md +++ /dev/null @@ -1,16 +0,0 @@ -# ProjectReadAssignee - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | **str** | Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. | -**url** | **str** | | [optional] [readonly] -**id** | **int** | | [optional] [readonly] -**first_name** | **str** | | [optional] -**last_name** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/ProjectReadOwner.md b/cvat-sdk/docs/ProjectReadOwner.md deleted file mode 100644 index 9c9414d0..00000000 --- a/cvat-sdk/docs/ProjectReadOwner.md +++ /dev/null @@ -1,16 +0,0 @@ -# ProjectReadOwner - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | **str** | Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. | -**url** | **str** | | [optional] [readonly] -**id** | **int** | | [optional] [readonly] -**first_name** | **str** | | [optional] -**last_name** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/ProjectReadTargetStorage.md b/cvat-sdk/docs/ProjectReadTargetStorage.md deleted file mode 100644 index a73d8dc3..00000000 --- a/cvat-sdk/docs/ProjectReadTargetStorage.md +++ /dev/null @@ -1,14 +0,0 @@ -# ProjectReadTargetStorage - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [readonly] -**location** | [**LocationEnum**](LocationEnum.md) | | [optional] -**cloud_storage_id** | **int, none_type** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/ProjectSearch.md b/cvat-sdk/docs/ProjectSearch.md deleted file mode 100644 index 764ce980..00000000 --- a/cvat-sdk/docs/ProjectSearch.md +++ /dev/null @@ -1,13 +0,0 @@ -# ProjectSearch - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [readonly] -**name** | **str** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/ProjectWrite.md b/cvat-sdk/docs/ProjectWrite.md deleted file mode 100644 index a7ea5af0..00000000 --- a/cvat-sdk/docs/ProjectWrite.md +++ /dev/null @@ -1,13 +0,0 @@ -# ProjectWrite - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | -**bug_tracker** | **str** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/ProjectWriteRequest.md b/cvat-sdk/docs/ProjectWriteRequest.md deleted file mode 100644 index cbe3f2de..00000000 --- a/cvat-sdk/docs/ProjectWriteRequest.md +++ /dev/null @@ -1,19 +0,0 @@ -# ProjectWriteRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | -**labels** | [**[PatchedLabelRequest]**](PatchedLabelRequest.md) | | [optional] if omitted the server will use the default value of [] -**owner_id** | **int, none_type** | | [optional] -**assignee_id** | **int, none_type** | | [optional] -**bug_tracker** | **str** | | [optional] -**target_storage** | [**PatchedProjectWriteRequestTargetStorage**](PatchedProjectWriteRequestTargetStorage.md) | | [optional] -**source_storage** | [**PatchedProjectWriteRequestTargetStorage**](PatchedProjectWriteRequestTargetStorage.md) | | [optional] -**task_subsets** | **[str]** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/ProjectsApi.md b/cvat-sdk/docs/ProjectsApi.md deleted file mode 100644 index 83f71100..00000000 --- a/cvat-sdk/docs/ProjectsApi.md +++ /dev/null @@ -1,1589 +0,0 @@ -# cvat_sdk.ProjectsApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**projects_create**](ProjectsApi.md#projects_create) | **POST** /api/projects | Method creates a new project -[**projects_create_backup**](ProjectsApi.md#projects_create_backup) | **POST** /api/projects/backup/ | Methods create a project from a backup -[**projects_create_dataset**](ProjectsApi.md#projects_create_dataset) | **POST** /api/projects/{id}/dataset/ | Import dataset in specific format as a project -[**projects_destroy**](ProjectsApi.md#projects_destroy) | **DELETE** /api/projects/{id} | Method deletes a specific project -[**projects_list**](ProjectsApi.md#projects_list) | **GET** /api/projects | Returns a paginated list of projects according to query parameters (12 projects per page) -[**projects_list_tasks**](ProjectsApi.md#projects_list_tasks) | **GET** /api/projects/{id}/tasks | Method returns information of the tasks of the project with the selected id -[**projects_partial_update**](ProjectsApi.md#projects_partial_update) | **PATCH** /api/projects/{id} | Methods does a partial update of chosen fields in a project -[**projects_partial_update_backup_file**](ProjectsApi.md#projects_partial_update_backup_file) | **PATCH** /api/projects/backup/{file_id} | Allows to upload a file chunk. Implements TUS file uploading protocol. -[**projects_partial_update_dataset_file**](ProjectsApi.md#projects_partial_update_dataset_file) | **PATCH** /api/projects/{id}/dataset/{file_id} | Allows to upload a file chunk. Implements TUS file uploading protocol. -[**projects_retrieve**](ProjectsApi.md#projects_retrieve) | **GET** /api/projects/{id} | Method returns details of a specific project -[**projects_retrieve_annotations**](ProjectsApi.md#projects_retrieve_annotations) | **GET** /api/projects/{id}/annotations | Method allows to download project annotations -[**projects_retrieve_backup**](ProjectsApi.md#projects_retrieve_backup) | **GET** /api/projects/{id}/backup | Methods creates a backup copy of a project -[**projects_retrieve_dataset**](ProjectsApi.md#projects_retrieve_dataset) | **GET** /api/projects/{id}/dataset/ | Export project as a dataset in a specific format - - -# **projects_create** -> ProjectWrite projects_create(project_write_request) - -Method creates a new project - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import projects_api -from cvat_sdk.model.project_write import ProjectWrite -from cvat_sdk.model.project_write_request import ProjectWriteRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = projects_api.ProjectsApi(api_client) - project_write_request = ProjectWriteRequest( - name="name_example", - labels=[ - PatchedLabelRequest( - id=1, - name="name_example", - color="color_example", - attributes=[ - AttributeRequest( - name="name_example", - mutable=True, - input_type=InputTypeEnum("checkbox"), - default_value="default_value_example", - values=[ - "values_example", - ], - ), - ], - deleted=True, - ), - ], - owner_id=1, - assignee_id=1, - bug_tracker="bug_tracker_example", - target_storage=PatchedProjectWriteRequestTargetStorage(None), - source_storage=PatchedProjectWriteRequestTargetStorage(None), - task_subsets=[ - "task_subsets_example", - ], - ) # ProjectWriteRequest | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method creates a new project - api_response = api_instance.projects_create(project_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_create: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method creates a new project - api_response = api_instance.projects_create(project_write_request, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_create: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **project_write_request** | [**ProjectWriteRequest**](ProjectWriteRequest.md)| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**ProjectWrite**](ProjectWrite.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **projects_create_backup** -> projects_create_backup(project_file_request) - -Methods create a project from a backup - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import projects_api -from cvat_sdk.model.project_file_request import ProjectFileRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = projects_api.ProjectsApi(api_client) - project_file_request = ProjectFileRequest( - project_file=open('/path/to/file', 'rb'), - ) # ProjectFileRequest | - x_organization = "X-Organization_example" # str | (optional) - cloud_storage_id = 3.14 # float | Storage id (optional) - filename = "filename_example" # str | Backup file name (optional) - location = "local" # str | Where to import the backup file from (optional) if omitted the server will use the default value of "local" - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Methods create a project from a backup - api_instance.projects_create_backup(project_file_request) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_create_backup: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Methods create a project from a backup - api_instance.projects_create_backup(project_file_request, x_organization=x_organization, cloud_storage_id=cloud_storage_id, filename=filename, location=location, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_create_backup: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **project_file_request** | [**ProjectFileRequest**](ProjectFileRequest.md)| | - **x_organization** | **str**| | [optional] - **cloud_storage_id** | **float**| Storage id | [optional] - **filename** | **str**| Backup file name | [optional] - **location** | **str**| Where to import the backup file from | [optional] if omitted the server will use the default value of "local" - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | The project has been imported | - | -**202** | Importing a backup file has been started | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **projects_create_dataset** -> projects_create_dataset(id, dataset_file_request) - -Import dataset in specific format as a project - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import projects_api -from cvat_sdk.model.dataset_file_request import DatasetFileRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = projects_api.ProjectsApi(api_client) - id = 1 # int | A unique integer value identifying this project. - dataset_file_request = DatasetFileRequest( - dataset_file=open('/path/to/file', 'rb'), - ) # DatasetFileRequest | - x_organization = "X-Organization_example" # str | (optional) - cloud_storage_id = 3.14 # float | Storage id (optional) - filename = "filename_example" # str | Dataset file name (optional) - format = "format_example" # str | Desired dataset format name You can get the list of supported formats at: /server/annotation/formats (optional) - location = "cloud_storage" # str | Where to import the dataset from (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - use_default_location = True # bool | Use the location that was configured in the project to import annotations (optional) if omitted the server will use the default value of True - - # example passing only required values which don't have defaults set - try: - # Import dataset in specific format as a project - api_instance.projects_create_dataset(id, dataset_file_request) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_create_dataset: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Import dataset in specific format as a project - api_instance.projects_create_dataset(id, dataset_file_request, x_organization=x_organization, cloud_storage_id=cloud_storage_id, filename=filename, format=format, location=location, org=org, org_id=org_id, use_default_location=use_default_location) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_create_dataset: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this project. | - **dataset_file_request** | [**DatasetFileRequest**](DatasetFileRequest.md)| | - **x_organization** | **str**| | [optional] - **cloud_storage_id** | **float**| Storage id | [optional] - **filename** | **str**| Dataset file name | [optional] - **format** | **str**| Desired dataset format name You can get the list of supported formats at: /server/annotation/formats | [optional] - **location** | **str**| Where to import the dataset from | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **use_default_location** | **bool**| Use the location that was configured in the project to import annotations | [optional] if omitted the server will use the default value of True - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**202** | Exporting has been started | - | -**400** | Failed to import dataset | - | -**405** | Format is not available | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **projects_destroy** -> projects_destroy(id) - -Method deletes a specific project - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import projects_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = projects_api.ProjectsApi(api_client) - id = 1 # int | A unique integer value identifying this project. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method deletes a specific project - api_instance.projects_destroy(id) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_destroy: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method deletes a specific project - api_instance.projects_destroy(id, x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_destroy: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this project. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | The project has been deleted | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **projects_list** -> PaginatedPolymorphicProjectList projects_list() - -Returns a paginated list of projects according to query parameters (12 projects per page) - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import projects_api -from cvat_sdk.model.paginated_polymorphic_project_list import PaginatedPolymorphicProjectList -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = projects_api.ProjectsApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - filter = "filter_example" # str | A filter term. Avaliable filter_fields: ['name', 'owner', 'assignee', 'status', 'id', 'updated_date'] (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - page = 1 # int | A page number within the paginated result set. (optional) - page_size = 1 # int | Number of results to return per page. (optional) - search = "search_example" # str | A search term. Avaliable search_fields: ('name', 'owner', 'assignee', 'status') (optional) - sort = "sort_example" # str | Which field to use when ordering the results. Avaliable ordering_fields: ['name', 'owner', 'assignee', 'status', 'id', 'updated_date'] (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Returns a paginated list of projects according to query parameters (12 projects per page) - api_response = api_instance.projects_list(x_organization=x_organization, filter=filter, org=org, org_id=org_id, page=page, page_size=page_size, search=search, sort=sort) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_list: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **filter** | **str**| A filter term. Avaliable filter_fields: ['name', 'owner', 'assignee', 'status', 'id', 'updated_date'] | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **page** | **int**| A page number within the paginated result set. | [optional] - **page_size** | **int**| Number of results to return per page. | [optional] - **search** | **str**| A search term. Avaliable search_fields: ('name', 'owner', 'assignee', 'status') | [optional] - **sort** | **str**| Which field to use when ordering the results. Avaliable ordering_fields: ['name', 'owner', 'assignee', 'status', 'id', 'updated_date'] | [optional] - -### Return type - -[**PaginatedPolymorphicProjectList**](PaginatedPolymorphicProjectList.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **projects_list_tasks** -> PaginatedTaskReadList projects_list_tasks(id) - -Method returns information of the tasks of the project with the selected id - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import projects_api -from cvat_sdk.model.paginated_task_read_list import PaginatedTaskReadList -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = projects_api.ProjectsApi(api_client) - id = 1 # int | A unique integer value identifying this project. - x_organization = "X-Organization_example" # str | (optional) - filter = "filter_example" # str | A filter term. Avaliable filter_fields: ['name', 'owner', 'assignee', 'status', 'id', 'updated_date'] (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - page = 1 # int | A page number within the paginated result set. (optional) - page_size = 1 # int | Number of results to return per page. (optional) - search = "search_example" # str | A search term. Avaliable search_fields: ('name', 'owner', 'assignee', 'status') (optional) - sort = "sort_example" # str | Which field to use when ordering the results. Avaliable ordering_fields: ['name', 'owner', 'assignee', 'status', 'id', 'updated_date'] (optional) - - # example passing only required values which don't have defaults set - try: - # Method returns information of the tasks of the project with the selected id - api_response = api_instance.projects_list_tasks(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_list_tasks: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns information of the tasks of the project with the selected id - api_response = api_instance.projects_list_tasks(id, x_organization=x_organization, filter=filter, org=org, org_id=org_id, page=page, page_size=page_size, search=search, sort=sort) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_list_tasks: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this project. | - **x_organization** | **str**| | [optional] - **filter** | **str**| A filter term. Avaliable filter_fields: ['name', 'owner', 'assignee', 'status', 'id', 'updated_date'] | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **page** | **int**| A page number within the paginated result set. | [optional] - **page_size** | **int**| Number of results to return per page. | [optional] - **search** | **str**| A search term. Avaliable search_fields: ('name', 'owner', 'assignee', 'status') | [optional] - **sort** | **str**| Which field to use when ordering the results. Avaliable ordering_fields: ['name', 'owner', 'assignee', 'status', 'id', 'updated_date'] | [optional] - -### Return type - -[**PaginatedTaskReadList**](PaginatedTaskReadList.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **projects_partial_update** -> ProjectWrite projects_partial_update(id) - -Methods does a partial update of chosen fields in a project - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import projects_api -from cvat_sdk.model.project_write import ProjectWrite -from cvat_sdk.model.patched_project_write_request import PatchedProjectWriteRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = projects_api.ProjectsApi(api_client) - id = 1 # int | A unique integer value identifying this project. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - patched_project_write_request = PatchedProjectWriteRequest( - name="name_example", - labels=[ - PatchedLabelRequest( - id=1, - name="name_example", - color="color_example", - attributes=[ - AttributeRequest( - name="name_example", - mutable=True, - input_type=InputTypeEnum("checkbox"), - default_value="default_value_example", - values=[ - "values_example", - ], - ), - ], - deleted=True, - ), - ], - owner_id=1, - assignee_id=1, - bug_tracker="bug_tracker_example", - target_storage=PatchedProjectWriteRequestTargetStorage(None), - source_storage=PatchedProjectWriteRequestTargetStorage(None), - task_subsets=[ - "task_subsets_example", - ], - ) # PatchedProjectWriteRequest | (optional) - - # example passing only required values which don't have defaults set - try: - # Methods does a partial update of chosen fields in a project - api_response = api_instance.projects_partial_update(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_partial_update: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Methods does a partial update of chosen fields in a project - api_response = api_instance.projects_partial_update(id, x_organization=x_organization, org=org, org_id=org_id, patched_project_write_request=patched_project_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_partial_update: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this project. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **patched_project_write_request** | [**PatchedProjectWriteRequest**](PatchedProjectWriteRequest.md)| | [optional] - -### Return type - -[**ProjectWrite**](ProjectWrite.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **projects_partial_update_backup_file** -> projects_partial_update_backup_file(file_id) - -Allows to upload a file chunk. Implements TUS file uploading protocol. - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import projects_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = projects_api.ProjectsApi(api_client) - file_id = "bf325375-e030-fccb-a009-17317c574773" # str | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - body = open('/path/to/file', 'rb') # file_type | (optional) - - # example passing only required values which don't have defaults set - try: - # Allows to upload a file chunk. Implements TUS file uploading protocol. - api_instance.projects_partial_update_backup_file(file_id) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_partial_update_backup_file: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Allows to upload a file chunk. Implements TUS file uploading protocol. - api_instance.projects_partial_update_backup_file(file_id, x_organization=x_organization, org=org, org_id=org_id, body=body) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_partial_update_backup_file: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file_id** | **str**| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **body** | **file_type**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: Not defined - - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **projects_partial_update_dataset_file** -> projects_partial_update_dataset_file(file_id, id) - -Allows to upload a file chunk. Implements TUS file uploading protocol. - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import projects_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = projects_api.ProjectsApi(api_client) - file_id = "bf325375-e030-fccb-a009-17317c574773" # str | - id = 1 # int | A unique integer value identifying this project. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - body = open('/path/to/file', 'rb') # file_type | (optional) - - # example passing only required values which don't have defaults set - try: - # Allows to upload a file chunk. Implements TUS file uploading protocol. - api_instance.projects_partial_update_dataset_file(file_id, id) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_partial_update_dataset_file: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Allows to upload a file chunk. Implements TUS file uploading protocol. - api_instance.projects_partial_update_dataset_file(file_id, id, x_organization=x_organization, org=org, org_id=org_id, body=body) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_partial_update_dataset_file: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file_id** | **str**| | - **id** | **int**| A unique integer value identifying this project. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **body** | **file_type**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: Not defined - - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **projects_retrieve** -> ProjectRead projects_retrieve(id) - -Method returns details of a specific project - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import projects_api -from cvat_sdk.model.project_read import ProjectRead -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = projects_api.ProjectsApi(api_client) - id = 1 # int | A unique integer value identifying this project. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method returns details of a specific project - api_response = api_instance.projects_retrieve(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_retrieve: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns details of a specific project - api_response = api_instance.projects_retrieve(id, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_retrieve: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this project. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**ProjectRead**](ProjectRead.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **projects_retrieve_annotations** -> projects_retrieve_annotations(format, id) - -Method allows to download project annotations - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import projects_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = projects_api.ProjectsApi(api_client) - format = "format_example" # str | Desired output format name You can get the list of supported formats at: /server/annotation/formats - id = 1 # int | A unique integer value identifying this project. - x_organization = "X-Organization_example" # str | (optional) - action = "download" # str | Used to start downloading process after annotation file had been created (optional) if omitted the server will use the default value of "download" - cloud_storage_id = 3.14 # float | Storage id (optional) - filename = "filename_example" # str | Desired output file name (optional) - location = "cloud_storage" # str | Where need to save downloaded dataset (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - use_default_location = True # bool | Use the location that was configured in project to export annotation (optional) if omitted the server will use the default value of True - - # example passing only required values which don't have defaults set - try: - # Method allows to download project annotations - api_instance.projects_retrieve_annotations(format, id) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_retrieve_annotations: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method allows to download project annotations - api_instance.projects_retrieve_annotations(format, id, x_organization=x_organization, action=action, cloud_storage_id=cloud_storage_id, filename=filename, location=location, org=org, org_id=org_id, use_default_location=use_default_location) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_retrieve_annotations: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **format** | **str**| Desired output format name You can get the list of supported formats at: /server/annotation/formats | - **id** | **int**| A unique integer value identifying this project. | - **x_organization** | **str**| | [optional] - **action** | **str**| Used to start downloading process after annotation file had been created | [optional] if omitted the server will use the default value of "download" - **cloud_storage_id** | **float**| Storage id | [optional] - **filename** | **str**| Desired output file name | [optional] - **location** | **str**| Where need to save downloaded dataset | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **use_default_location** | **bool**| Use the location that was configured in project to export annotation | [optional] if omitted the server will use the default value of True - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Download of file started | - | -**201** | Annotations file is ready to download | - | -**202** | Dump of annotations has been started | - | -**401** | Format is not specified | - | -**405** | Format is not available | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **projects_retrieve_backup** -> projects_retrieve_backup(id) - -Methods creates a backup copy of a project - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import projects_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = projects_api.ProjectsApi(api_client) - id = 1 # int | A unique integer value identifying this project. - x_organization = "X-Organization_example" # str | (optional) - action = "download" # str | Used to start downloading process after backup file had been created (optional) if omitted the server will use the default value of "download" - cloud_storage_id = 3.14 # float | Storage id (optional) - filename = "filename_example" # str | Backup file name (optional) - location = "cloud_storage" # str | Where need to save downloaded backup (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - use_default_location = True # bool | Use the location that was configured in project to export backup (optional) if omitted the server will use the default value of True - - # example passing only required values which don't have defaults set - try: - # Methods creates a backup copy of a project - api_instance.projects_retrieve_backup(id) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_retrieve_backup: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Methods creates a backup copy of a project - api_instance.projects_retrieve_backup(id, x_organization=x_organization, action=action, cloud_storage_id=cloud_storage_id, filename=filename, location=location, org=org, org_id=org_id, use_default_location=use_default_location) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_retrieve_backup: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this project. | - **x_organization** | **str**| | [optional] - **action** | **str**| Used to start downloading process after backup file had been created | [optional] if omitted the server will use the default value of "download" - **cloud_storage_id** | **float**| Storage id | [optional] - **filename** | **str**| Backup file name | [optional] - **location** | **str**| Where need to save downloaded backup | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **use_default_location** | **bool**| Use the location that was configured in project to export backup | [optional] if omitted the server will use the default value of True - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Download of file started | - | -**201** | Output backup file is ready for downloading | - | -**202** | Creating a backup file has been started | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **projects_retrieve_dataset** -> projects_retrieve_dataset(id) - -Export project as a dataset in a specific format - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import projects_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = projects_api.ProjectsApi(api_client) - id = 1 # int | A unique integer value identifying this project. - x_organization = "X-Organization_example" # str | (optional) - action = "download" # str | Used to start downloading process after annotation file had been created (optional) - cloud_storage_id = 3.14 # float | Storage id (optional) - filename = "filename_example" # str | Desired output file name (optional) - format = "format_example" # str | Desired output format name You can get the list of supported formats at: /server/annotation/formats (optional) - location = "cloud_storage" # str | Where need to save downloaded dataset (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - use_default_location = True # bool | Use the location that was configured in project to import dataset (optional) if omitted the server will use the default value of True - - # example passing only required values which don't have defaults set - try: - # Export project as a dataset in a specific format - api_instance.projects_retrieve_dataset(id) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_retrieve_dataset: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Export project as a dataset in a specific format - api_instance.projects_retrieve_dataset(id, x_organization=x_organization, action=action, cloud_storage_id=cloud_storage_id, filename=filename, format=format, location=location, org=org, org_id=org_id, use_default_location=use_default_location) - except cvat_sdk.ApiException as e: - print("Exception when calling ProjectsApi->projects_retrieve_dataset: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this project. | - **x_organization** | **str**| | [optional] - **action** | **str**| Used to start downloading process after annotation file had been created | [optional] - **cloud_storage_id** | **float**| Storage id | [optional] - **filename** | **str**| Desired output file name | [optional] - **format** | **str**| Desired output format name You can get the list of supported formats at: /server/annotation/formats | [optional] - **location** | **str**| Where need to save downloaded dataset | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **use_default_location** | **bool**| Use the location that was configured in project to import dataset | [optional] if omitted the server will use the default value of True - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Download of file started | - | -**201** | Output file is ready for downloading | - | -**202** | Exporting has been started | - | -**405** | Format is not available | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/cvat-sdk/docs/ProviderTypeEnum.md b/cvat-sdk/docs/ProviderTypeEnum.md deleted file mode 100644 index 726f77d2..00000000 --- a/cvat-sdk/docs/ProviderTypeEnum.md +++ /dev/null @@ -1,11 +0,0 @@ -# ProviderTypeEnum - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["AWS_S3_BUCKET", "AZURE_CONTAINER", "GOOGLE_DRIVE", "GOOGLE_CLOUD_STORAGE", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/RestAuthDetail.md b/cvat-sdk/docs/RestAuthDetail.md deleted file mode 100644 index cc9de698..00000000 --- a/cvat-sdk/docs/RestAuthDetail.md +++ /dev/null @@ -1,12 +0,0 @@ -# RestAuthDetail - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**detail** | **str** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/RestrictedRegister.md b/cvat-sdk/docs/RestrictedRegister.md deleted file mode 100644 index a21cea09..00000000 --- a/cvat-sdk/docs/RestrictedRegister.md +++ /dev/null @@ -1,16 +0,0 @@ -# RestrictedRegister - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | **str** | | -**email** | **str** | | [optional] -**first_name** | **str** | | [optional] -**last_name** | **str** | | [optional] -**confirmations** | [**[UserAgreement]**](UserAgreement.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/RestrictedRegisterRequest.md b/cvat-sdk/docs/RestrictedRegisterRequest.md deleted file mode 100644 index 6e6193e0..00000000 --- a/cvat-sdk/docs/RestrictedRegisterRequest.md +++ /dev/null @@ -1,18 +0,0 @@ -# RestrictedRegisterRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | **str** | | -**password1** | **str** | | -**password2** | **str** | | -**email** | **str** | | [optional] -**first_name** | **str** | | [optional] -**last_name** | **str** | | [optional] -**confirmations** | [**[UserAgreementRequest]**](UserAgreementRequest.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/RestrictionsApi.md b/cvat-sdk/docs/RestrictionsApi.md deleted file mode 100644 index af2d95a6..00000000 --- a/cvat-sdk/docs/RestrictionsApi.md +++ /dev/null @@ -1,148 +0,0 @@ -# cvat_sdk.RestrictionsApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**restrictions_retrieve_terms_of_use**](RestrictionsApi.md#restrictions_retrieve_terms_of_use) | **GET** /api/restrictions/terms-of-use | Method provides CVAT terms of use -[**restrictions_retrieve_user_agreements**](RestrictionsApi.md#restrictions_retrieve_user_agreements) | **GET** /api/restrictions/user-agreements | Method provides user agreements that the user must accept to register - - -# **restrictions_retrieve_terms_of_use** -> restrictions_retrieve_terms_of_use() - -Method provides CVAT terms of use - -### Example - - -```python -import time -import cvat_sdk -from cvat_sdk.api import restrictions_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient() as api_client: - # Create an instance of the API class - api_instance = restrictions_api.RestrictionsApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method provides CVAT terms of use - api_instance.restrictions_retrieve_terms_of_use(x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling RestrictionsApi->restrictions_retrieve_terms_of_use: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | CVAT terms of use | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **restrictions_retrieve_user_agreements** -> UserAgreement restrictions_retrieve_user_agreements() - -Method provides user agreements that the user must accept to register - -### Example - - -```python -import time -import cvat_sdk -from cvat_sdk.api import restrictions_api -from cvat_sdk.model.user_agreement import UserAgreement -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient() as api_client: - # Create an instance of the API class - api_instance = restrictions_api.RestrictionsApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method provides user agreements that the user must accept to register - api_response = api_instance.restrictions_retrieve_user_agreements(x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling RestrictionsApi->restrictions_retrieve_user_agreements: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**UserAgreement**](UserAgreement.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/cvat-sdk/docs/RoleEnum.md b/cvat-sdk/docs/RoleEnum.md deleted file mode 100644 index 3cb9125e..00000000 --- a/cvat-sdk/docs/RoleEnum.md +++ /dev/null @@ -1,11 +0,0 @@ -# RoleEnum - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["worker", "supervisor", "maintainer", "owner", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/RqStatus.md b/cvat-sdk/docs/RqStatus.md deleted file mode 100644 index 6f081f57..00000000 --- a/cvat-sdk/docs/RqStatus.md +++ /dev/null @@ -1,14 +0,0 @@ -# RqStatus - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**state** | [**RqStatusStateEnum**](RqStatusStateEnum.md) | | -**message** | **str** | | [optional] if omitted the server will use the default value of "" -**progress** | **float** | | [optional] if omitted the server will use the default value of 0.0 -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/RqStatusStateEnum.md b/cvat-sdk/docs/RqStatusStateEnum.md deleted file mode 100644 index ba83f6f3..00000000 --- a/cvat-sdk/docs/RqStatusStateEnum.md +++ /dev/null @@ -1,11 +0,0 @@ -# RqStatusStateEnum - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["Queued", "Started", "Finished", "Failed", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/SchemaApi.md b/cvat-sdk/docs/SchemaApi.md deleted file mode 100644 index 94ffce6f..00000000 --- a/cvat-sdk/docs/SchemaApi.md +++ /dev/null @@ -1,115 +0,0 @@ -# cvat_sdk.SchemaApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**schema_retrieve**](SchemaApi.md#schema_retrieve) | **GET** /api/schema/ | - - -# **schema_retrieve** -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} schema_retrieve() - - - -OpenApi3 schema for this API. Format can be selected via content negotiation. - YAML: application/vnd.oai.openapi - JSON: application/vnd.oai.openapi+json - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import schema_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = schema_api.SchemaApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - lang = "af" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - scheme = "json" # str | (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - api_response = api_instance.schema_retrieve(x_organization=x_organization, lang=lang, org=org, org_id=org_id, scheme=scheme) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling SchemaApi->schema_retrieve: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **lang** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **scheme** | **str**| | [optional] - -### Return type - -**{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.oai.openapi, application/yaml, application/vnd.oai.openapi+json, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/cvat-sdk/docs/Segment.md b/cvat-sdk/docs/Segment.md deleted file mode 100644 index ac10f5ec..00000000 --- a/cvat-sdk/docs/Segment.md +++ /dev/null @@ -1,14 +0,0 @@ -# Segment - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**jobs** | [**[SimpleJob]**](SimpleJob.md) | | -**start_frame** | **int** | | [optional] [readonly] -**stop_frame** | **int** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/ServerApi.md b/cvat-sdk/docs/ServerApi.md deleted file mode 100644 index 990e2f9c..00000000 --- a/cvat-sdk/docs/ServerApi.md +++ /dev/null @@ -1,681 +0,0 @@ -# cvat_sdk.ServerApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**server_create_exception**](ServerApi.md#server_create_exception) | **POST** /api/server/exception | Method saves an exception from a client on the server -[**server_create_logs**](ServerApi.md#server_create_logs) | **POST** /api/server/logs | Method saves logs from a client on the server -[**server_list_share**](ServerApi.md#server_list_share) | **GET** /api/server/share | Returns all files and folders that are on the server along specified path -[**server_retrieve_about**](ServerApi.md#server_retrieve_about) | **GET** /api/server/about | Method provides basic CVAT information -[**server_retrieve_annotation_formats**](ServerApi.md#server_retrieve_annotation_formats) | **GET** /api/server/annotation/formats | Method provides the list of supported annotations formats -[**server_retrieve_plugins**](ServerApi.md#server_retrieve_plugins) | **GET** /api/server/plugins | Method provides allowed plugins - - -# **server_create_exception** -> Exception server_create_exception(exception_request) - -Method saves an exception from a client on the server - -Sends logs to the ELK if it is connected - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import server_api -from cvat_sdk.model.exception_request import ExceptionRequest -from cvat_sdk.model.exception import Exception -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = server_api.ServerApi(api_client) - exception_request = ExceptionRequest( - system="system_example", - client="client_example", - time=dateutil_parser('1970-01-01T00:00:00.00Z'), - job_id=1, - task_id=1, - proj_id=1, - client_id=1, - message="message_example", - filename="filename_example", - line=1, - column=1, - stack="stack_example", - ) # ExceptionRequest | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method saves an exception from a client on the server - api_response = api_instance.server_create_exception(exception_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling ServerApi->server_create_exception: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method saves an exception from a client on the server - api_response = api_instance.server_create_exception(exception_request, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling ServerApi->server_create_exception: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **exception_request** | [**ExceptionRequest**](ExceptionRequest.md)| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**Exception**](Exception.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **server_create_logs** -> [LogEvent] server_create_logs(log_event_request) - -Method saves logs from a client on the server - -Sends logs to the ELK if it is connected - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import server_api -from cvat_sdk.model.log_event import LogEvent -from cvat_sdk.model.log_event_request import LogEventRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = server_api.ServerApi(api_client) - log_event_request = [ - LogEventRequest( - job_id=1, - task_id=1, - proj_id=1, - client_id=1, - name="name_example", - time=dateutil_parser('1970-01-01T00:00:00.00Z'), - message="message_example", - payload={ - "key": None, - }, - is_active=True, - ), - ] # [LogEventRequest] | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method saves logs from a client on the server - api_response = api_instance.server_create_logs(log_event_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling ServerApi->server_create_logs: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method saves logs from a client on the server - api_response = api_instance.server_create_logs(log_event_request, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling ServerApi->server_create_logs: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **log_event_request** | [**[LogEventRequest]**](LogEventRequest.md)| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**[LogEvent]**](LogEvent.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **server_list_share** -> [FileInfo] server_list_share() - -Returns all files and folders that are on the server along specified path - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import server_api -from cvat_sdk.model.file_info import FileInfo -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = server_api.ServerApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - directory = "directory_example" # str | Directory to browse (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Returns all files and folders that are on the server along specified path - api_response = api_instance.server_list_share(x_organization=x_organization, directory=directory, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling ServerApi->server_list_share: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **directory** | **str**| Directory to browse | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**[FileInfo]**](FileInfo.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **server_retrieve_about** -> About server_retrieve_about() - -Method provides basic CVAT information - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import server_api -from cvat_sdk.model.about import About -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = server_api.ServerApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method provides basic CVAT information - api_response = api_instance.server_retrieve_about(x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling ServerApi->server_retrieve_about: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**About**](About.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **server_retrieve_annotation_formats** -> DatasetFormats server_retrieve_annotation_formats() - -Method provides the list of supported annotations formats - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import server_api -from cvat_sdk.model.dataset_formats import DatasetFormats -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = server_api.ServerApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method provides the list of supported annotations formats - api_response = api_instance.server_retrieve_annotation_formats(x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling ServerApi->server_retrieve_annotation_formats: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**DatasetFormats**](DatasetFormats.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **server_retrieve_plugins** -> Plugins server_retrieve_plugins() - -Method provides allowed plugins - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import server_api -from cvat_sdk.model.plugins import Plugins -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = server_api.ServerApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method provides allowed plugins - api_response = api_instance.server_retrieve_plugins(x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling ServerApi->server_retrieve_plugins: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**Plugins**](Plugins.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/cvat-sdk/docs/ShapeType.md b/cvat-sdk/docs/ShapeType.md deleted file mode 100644 index 8a2fce71..00000000 --- a/cvat-sdk/docs/ShapeType.md +++ /dev/null @@ -1,11 +0,0 @@ -# ShapeType - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["rectangle", "polygon", "polyline", "points", "ellipse", "cuboid", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/SigningRequest.md b/cvat-sdk/docs/SigningRequest.md deleted file mode 100644 index 8f759636..00000000 --- a/cvat-sdk/docs/SigningRequest.md +++ /dev/null @@ -1,12 +0,0 @@ -# SigningRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**url** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/SimpleJob.md b/cvat-sdk/docs/SimpleJob.md deleted file mode 100644 index 3f4a9f40..00000000 --- a/cvat-sdk/docs/SimpleJob.md +++ /dev/null @@ -1,17 +0,0 @@ -# SimpleJob - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**assignee** | [**CommentReadOwner**](CommentReadOwner.md) | | -**url** | **str** | | [optional] [readonly] -**id** | **int** | | [optional] [readonly] -**status** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] [readonly] -**stage** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] [readonly] -**state** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/SortingMethod.md b/cvat-sdk/docs/SortingMethod.md deleted file mode 100644 index ba228367..00000000 --- a/cvat-sdk/docs/SortingMethod.md +++ /dev/null @@ -1,11 +0,0 @@ -# SortingMethod - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["lexicographical", "natural", "predefined", "random", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/Storage.md b/cvat-sdk/docs/Storage.md deleted file mode 100644 index febd40fe..00000000 --- a/cvat-sdk/docs/Storage.md +++ /dev/null @@ -1,14 +0,0 @@ -# Storage - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [readonly] -**location** | [**LocationEnum**](LocationEnum.md) | | [optional] -**cloud_storage_id** | **int, none_type** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/StorageMethod.md b/cvat-sdk/docs/StorageMethod.md deleted file mode 100644 index 8ef67945..00000000 --- a/cvat-sdk/docs/StorageMethod.md +++ /dev/null @@ -1,11 +0,0 @@ -# StorageMethod - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["cache", "file_system", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/StorageRequest.md b/cvat-sdk/docs/StorageRequest.md deleted file mode 100644 index d37b8ba5..00000000 --- a/cvat-sdk/docs/StorageRequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# StorageRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**location** | [**LocationEnum**](LocationEnum.md) | | [optional] -**cloud_storage_id** | **int, none_type** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/StorageType.md b/cvat-sdk/docs/StorageType.md deleted file mode 100644 index 59c40c0a..00000000 --- a/cvat-sdk/docs/StorageType.md +++ /dev/null @@ -1,11 +0,0 @@ -# StorageType - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["cloud_storage", "local", "share", ] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/TaskFileRequest.md b/cvat-sdk/docs/TaskFileRequest.md deleted file mode 100644 index 41fce4a4..00000000 --- a/cvat-sdk/docs/TaskFileRequest.md +++ /dev/null @@ -1,12 +0,0 @@ -# TaskFileRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**task_file** | **file_type** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/TaskRead.md b/cvat-sdk/docs/TaskRead.md deleted file mode 100644 index e139ebb5..00000000 --- a/cvat-sdk/docs/TaskRead.md +++ /dev/null @@ -1,37 +0,0 @@ -# TaskRead - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**url** | **str** | | [optional] [readonly] -**id** | **int** | | [optional] [readonly] -**name** | **str** | | [optional] [readonly] -**project_id** | **int, none_type** | | [optional] -**mode** | **str** | | [optional] [readonly] -**owner** | [**BasicUser**](BasicUser.md) | | [optional] -**assignee** | [**CommentReadOwner**](CommentReadOwner.md) | | [optional] -**bug_tracker** | **str** | | [optional] [readonly] -**created_date** | **datetime** | | [optional] [readonly] -**updated_date** | **datetime** | | [optional] [readonly] -**overlap** | **int** | | [optional] [readonly] -**segment_size** | **int** | | [optional] [readonly] -**status** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] [readonly] -**labels** | [**[Label]**](Label.md) | | [optional] -**segments** | [**[Segment]**](Segment.md) | | [optional] [readonly] -**data_chunk_size** | **int, none_type** | | [optional] [readonly] -**data_compressed_chunk_type** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] [readonly] -**data_original_chunk_type** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional] [readonly] -**size** | **int** | | [optional] [readonly] -**image_quality** | **int** | | [optional] [readonly] -**data** | **int** | | [optional] [readonly] -**dimension** | **str** | | [optional] -**subset** | **str** | | [optional] [readonly] -**organization** | **int, none_type** | | [optional] [readonly] -**target_storage** | [**TaskReadTargetStorage**](TaskReadTargetStorage.md) | | [optional] -**source_storage** | [**TaskReadTargetStorage**](TaskReadTargetStorage.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/TaskReadTargetStorage.md b/cvat-sdk/docs/TaskReadTargetStorage.md deleted file mode 100644 index fc51b475..00000000 --- a/cvat-sdk/docs/TaskReadTargetStorage.md +++ /dev/null @@ -1,14 +0,0 @@ -# TaskReadTargetStorage - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [readonly] -**location** | [**LocationEnum**](LocationEnum.md) | | [optional] -**cloud_storage_id** | **int, none_type** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/TaskWrite.md b/cvat-sdk/docs/TaskWrite.md deleted file mode 100644 index c42ce66e..00000000 --- a/cvat-sdk/docs/TaskWrite.md +++ /dev/null @@ -1,23 +0,0 @@ -# TaskWrite - -Adds support for write once fields to serializers. To use it, specify a list of fields as `write_once_fields` on the serializer's Meta: ``` class Meta: model = SomeModel fields = '__all__' write_once_fields = ('collection', ) ``` Now the fields in `write_once_fields` can be set during POST (create), but cannot be changed afterwards via PUT or PATCH (update). Inspired by http://stackoverflow.com/a/37487134/627411. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | -**url** | **str** | | [optional] [readonly] -**id** | **int** | | [optional] [readonly] -**project_id** | **int, none_type** | | [optional] -**bug_tracker** | **str** | | [optional] -**overlap** | **int, none_type** | | [optional] -**segment_size** | **int** | | [optional] -**labels** | [**[Label]**](Label.md) | | [optional] -**subset** | **str** | | [optional] -**target_storage** | [**TaskReadTargetStorage**](TaskReadTargetStorage.md) | | [optional] -**source_storage** | [**TaskReadTargetStorage**](TaskReadTargetStorage.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/TaskWriteRequest.md b/cvat-sdk/docs/TaskWriteRequest.md deleted file mode 100644 index 6a5fc721..00000000 --- a/cvat-sdk/docs/TaskWriteRequest.md +++ /dev/null @@ -1,23 +0,0 @@ -# TaskWriteRequest - -Adds support for write once fields to serializers. To use it, specify a list of fields as `write_once_fields` on the serializer's Meta: ``` class Meta: model = SomeModel fields = '__all__' write_once_fields = ('collection', ) ``` Now the fields in `write_once_fields` can be set during POST (create), but cannot be changed afterwards via PUT or PATCH (update). Inspired by http://stackoverflow.com/a/37487134/627411. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | -**project_id** | **int, none_type** | | [optional] -**owner_id** | **int, none_type** | | [optional] -**assignee_id** | **int, none_type** | | [optional] -**bug_tracker** | **str** | | [optional] -**overlap** | **int, none_type** | | [optional] -**segment_size** | **int** | | [optional] -**labels** | [**[PatchedLabelRequest]**](PatchedLabelRequest.md) | | [optional] -**subset** | **str** | | [optional] -**target_storage** | [**PatchedTaskWriteRequestTargetStorage**](PatchedTaskWriteRequestTargetStorage.md) | | [optional] -**source_storage** | [**PatchedTaskWriteRequestTargetStorage**](PatchedTaskWriteRequestTargetStorage.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/TasksApi.md b/cvat-sdk/docs/TasksApi.md deleted file mode 100644 index f1730893..00000000 --- a/cvat-sdk/docs/TasksApi.md +++ /dev/null @@ -1,3023 +0,0 @@ -# cvat_sdk.TasksApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**jobs_partial_update_data_meta**](TasksApi.md#jobs_partial_update_data_meta) | **PATCH** /api/jobs/{id}/data/meta | Method provides a meta information about media files which are related with the job -[**tasks_create**](TasksApi.md#tasks_create) | **POST** /api/tasks | Method creates a new task in a database without any attached images and videos -[**tasks_create_annotations**](TasksApi.md#tasks_create_annotations) | **POST** /api/tasks/{id}/annotations/ | Method allows to upload task annotations from storage -[**tasks_create_backup**](TasksApi.md#tasks_create_backup) | **POST** /api/tasks/backup/ | Method recreates a task from an attached task backup file -[**tasks_create_data**](TasksApi.md#tasks_create_data) | **POST** /api/tasks/{id}/data/ | Method permanently attaches images or video to a task. Supports tus uploads, see more https://tus.io/ -[**tasks_destroy**](TasksApi.md#tasks_destroy) | **DELETE** /api/tasks/{id} | Method deletes a specific task, all attached jobs, annotations, and data -[**tasks_destroy_annotations**](TasksApi.md#tasks_destroy_annotations) | **DELETE** /api/tasks/{id}/annotations/ | Method deletes all annotations for a specific task -[**tasks_list**](TasksApi.md#tasks_list) | **GET** /api/tasks | Returns a paginated list of tasks according to query parameters (10 tasks per page) -[**tasks_list_jobs**](TasksApi.md#tasks_list_jobs) | **GET** /api/tasks/{id}/jobs | Method returns a list of jobs for a specific task -[**tasks_partial_update**](TasksApi.md#tasks_partial_update) | **PATCH** /api/tasks/{id} | Methods does a partial update of chosen fields in a task -[**tasks_partial_update_annotations**](TasksApi.md#tasks_partial_update_annotations) | **PATCH** /api/tasks/{id}/annotations/ | Method performs a partial update of annotations in a specific task -[**tasks_partial_update_annotations_file**](TasksApi.md#tasks_partial_update_annotations_file) | **PATCH** /api/tasks/{id}/annotations/{file_id} | Allows to upload an annotation file chunk. Implements TUS file uploading protocol. -[**tasks_partial_update_backup_file**](TasksApi.md#tasks_partial_update_backup_file) | **PATCH** /api/tasks/backup/{file_id} | Allows to upload a file chunk. Implements TUS file uploading protocol. -[**tasks_partial_update_data_file**](TasksApi.md#tasks_partial_update_data_file) | **PATCH** /api/tasks/{id}/data/{file_id} | Allows to upload a file chunk. Implements TUS file uploading protocol. -[**tasks_partial_update_data_meta**](TasksApi.md#tasks_partial_update_data_meta) | **PATCH** /api/tasks/{id}/data/meta | Method provides a meta information about media files which are related with the task -[**tasks_retrieve**](TasksApi.md#tasks_retrieve) | **GET** /api/tasks/{id} | Method returns details of a specific task -[**tasks_retrieve_annotations**](TasksApi.md#tasks_retrieve_annotations) | **GET** /api/tasks/{id}/annotations/ | Method allows to download task annotations -[**tasks_retrieve_backup**](TasksApi.md#tasks_retrieve_backup) | **GET** /api/tasks/{id}/backup | Method backup a specified task -[**tasks_retrieve_data**](TasksApi.md#tasks_retrieve_data) | **GET** /api/tasks/{id}/data/ | Method returns data for a specific task -[**tasks_retrieve_data_meta**](TasksApi.md#tasks_retrieve_data_meta) | **GET** /api/tasks/{id}/data/meta | Method provides a meta information about media files which are related with the task -[**tasks_retrieve_dataset**](TasksApi.md#tasks_retrieve_dataset) | **GET** /api/tasks/{id}/dataset | Export task as a dataset in a specific format -[**tasks_retrieve_status**](TasksApi.md#tasks_retrieve_status) | **GET** /api/tasks/{id}/status | When task is being created the method returns information about a status of the creation process -[**tasks_update**](TasksApi.md#tasks_update) | **PUT** /api/tasks/{id} | Method updates a task by id -[**tasks_update_annotations**](TasksApi.md#tasks_update_annotations) | **PUT** /api/tasks/{id}/annotations/ | Method allows to upload task annotations - - -# **jobs_partial_update_data_meta** -> DataMetaRead jobs_partial_update_data_meta(id) - -Method provides a meta information about media files which are related with the job - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from cvat_sdk.model.patched_job_write_request import PatchedJobWriteRequest -from cvat_sdk.model.data_meta_read import DataMetaRead -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - id = 1 # int | A unique integer value identifying this job. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - patched_job_write_request = PatchedJobWriteRequest( - assignee=1, - stage=JobStage("annotation"), - state=OperationStatus("new"), - ) # PatchedJobWriteRequest | (optional) - - # example passing only required values which don't have defaults set - try: - # Method provides a meta information about media files which are related with the job - api_response = api_instance.jobs_partial_update_data_meta(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->jobs_partial_update_data_meta: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method provides a meta information about media files which are related with the job - api_response = api_instance.jobs_partial_update_data_meta(id, x_organization=x_organization, org=org, org_id=org_id, patched_job_write_request=patched_job_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->jobs_partial_update_data_meta: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this job. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **patched_job_write_request** | [**PatchedJobWriteRequest**](PatchedJobWriteRequest.md)| | [optional] - -### Return type - -[**DataMetaRead**](DataMetaRead.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_create** -> TaskWrite tasks_create(task_write_request) - -Method creates a new task in a database without any attached images and videos - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from cvat_sdk.model.task_write import TaskWrite -from cvat_sdk.model.task_write_request import TaskWriteRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - task_write_request = TaskWriteRequest( - name="name_example", - project_id=1, - owner_id=1, - assignee_id=1, - bug_tracker="bug_tracker_example", - overlap=1, - segment_size=1, - labels=[ - PatchedLabelRequest( - id=1, - name="name_example", - color="color_example", - attributes=[ - AttributeRequest( - name="name_example", - mutable=True, - input_type=InputTypeEnum("checkbox"), - default_value="default_value_example", - values=[ - "values_example", - ], - ), - ], - deleted=True, - ), - ], - subset="subset_example", - target_storage=PatchedTaskWriteRequestTargetStorage(None), - source_storage=PatchedTaskWriteRequestTargetStorage(None), - ) # TaskWriteRequest | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method creates a new task in a database without any attached images and videos - api_response = api_instance.tasks_create(task_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_create: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method creates a new task in a database without any attached images and videos - api_response = api_instance.tasks_create(task_write_request, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_create: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **task_write_request** | [**TaskWriteRequest**](TaskWriteRequest.md)| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**TaskWrite**](TaskWrite.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_create_annotations** -> tasks_create_annotations(id, task_write_request) - -Method allows to upload task annotations from storage - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from cvat_sdk.model.task_write_request import TaskWriteRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - id = 1 # int | A unique integer value identifying this task. - task_write_request = TaskWriteRequest( - name="name_example", - project_id=1, - owner_id=1, - assignee_id=1, - bug_tracker="bug_tracker_example", - overlap=1, - segment_size=1, - labels=[ - PatchedLabelRequest( - id=1, - name="name_example", - color="color_example", - attributes=[ - AttributeRequest( - name="name_example", - mutable=True, - input_type=InputTypeEnum("checkbox"), - default_value="default_value_example", - values=[ - "values_example", - ], - ), - ], - deleted=True, - ), - ], - subset="subset_example", - target_storage=PatchedTaskWriteRequestTargetStorage(None), - source_storage=PatchedTaskWriteRequestTargetStorage(None), - ) # TaskWriteRequest | - x_organization = "X-Organization_example" # str | (optional) - cloud_storage_id = 3.14 # float | Storage id (optional) - filename = "filename_example" # str | Annotation file name (optional) - format = "format_example" # str | Input format name You can get the list of supported formats at: /server/annotation/formats (optional) - location = "cloud_storage" # str | where to import the annotation from (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - use_default_location = True # bool | Use the location that was configured in task to import annotations (optional) if omitted the server will use the default value of True - - # example passing only required values which don't have defaults set - try: - # Method allows to upload task annotations from storage - api_instance.tasks_create_annotations(id, task_write_request) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_create_annotations: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method allows to upload task annotations from storage - api_instance.tasks_create_annotations(id, task_write_request, x_organization=x_organization, cloud_storage_id=cloud_storage_id, filename=filename, format=format, location=location, org=org, org_id=org_id, use_default_location=use_default_location) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_create_annotations: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this task. | - **task_write_request** | [**TaskWriteRequest**](TaskWriteRequest.md)| | - **x_organization** | **str**| | [optional] - **cloud_storage_id** | **float**| Storage id | [optional] - **filename** | **str**| Annotation file name | [optional] - **format** | **str**| Input format name You can get the list of supported formats at: /server/annotation/formats | [optional] - **location** | **str**| where to import the annotation from | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **use_default_location** | **bool**| Use the location that was configured in task to import annotations | [optional] if omitted the server will use the default value of True - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | Uploading has finished | - | -**202** | Uploading has been started | - | -**405** | Format is not available | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_create_backup** -> tasks_create_backup(task_file_request) - -Method recreates a task from an attached task backup file - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from cvat_sdk.model.task_file_request import TaskFileRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - task_file_request = TaskFileRequest( - task_file=open('/path/to/file', 'rb'), - ) # TaskFileRequest | - x_organization = "X-Organization_example" # str | (optional) - cloud_storage_id = 3.14 # float | Storage id (optional) - filename = "filename_example" # str | Backup file name (optional) - location = "local" # str | Where to import the backup file from (optional) if omitted the server will use the default value of "local" - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method recreates a task from an attached task backup file - api_instance.tasks_create_backup(task_file_request) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_create_backup: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method recreates a task from an attached task backup file - api_instance.tasks_create_backup(task_file_request, x_organization=x_organization, cloud_storage_id=cloud_storage_id, filename=filename, location=location, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_create_backup: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **task_file_request** | [**TaskFileRequest**](TaskFileRequest.md)| | - **x_organization** | **str**| | [optional] - **cloud_storage_id** | **float**| Storage id | [optional] - **filename** | **str**| Backup file name | [optional] - **location** | **str**| Where to import the backup file from | [optional] if omitted the server will use the default value of "local" - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | The task has been imported | - | -**202** | Importing a backup file has been started | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_create_data** -> tasks_create_data(id, data_request) - -Method permanently attaches images or video to a task. Supports tus uploads, see more https://tus.io/ - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from cvat_sdk.model.data_request import DataRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - id = 1 # int | A unique integer value identifying this task. - data_request = DataRequest( - chunk_size=1, - size=1, - image_quality=0, - start_frame=1, - stop_frame=1, - frame_filter="frame_filter_example", - compressed_chunk_type=ChunkType("video"), - original_chunk_type=ChunkType("video"), - client_files=[], - server_files=[], - remote_files=[], - use_zip_chunks=False, - cloud_storage_id=1, - use_cache=False, - copy_data=False, - storage_method=StorageMethod("cache"), - storage=StorageType("cloud_storage"), - sorting_method=SortingMethod("lexicographical"), - ) # DataRequest | - upload_finish = True # bool | Finishes data upload. Can be combined with Upload-Start header to create task data with one request (optional) - upload_multiple = True # bool | Indicates that data with this request are single or multiple files that should be attached to a task (optional) - upload_start = True # bool | Initializes data upload. No data should be sent with this header (optional) - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method permanently attaches images or video to a task. Supports tus uploads, see more https://tus.io/ - api_instance.tasks_create_data(id, data_request) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_create_data: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method permanently attaches images or video to a task. Supports tus uploads, see more https://tus.io/ - api_instance.tasks_create_data(id, data_request, upload_finish=upload_finish, upload_multiple=upload_multiple, upload_start=upload_start, x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_create_data: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this task. | - **data_request** | [**DataRequest**](DataRequest.md)| | - **upload_finish** | **bool**| Finishes data upload. Can be combined with Upload-Start header to create task data with one request | [optional] - **upload_multiple** | **bool**| Indicates that data with this request are single or multiple files that should be attached to a task | [optional] - **upload_start** | **bool**| Initializes data upload. No data should be sent with this header | [optional] - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**202** | No response body | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_destroy** -> tasks_destroy(id) - -Method deletes a specific task, all attached jobs, annotations, and data - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - id = 1 # int | A unique integer value identifying this task. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method deletes a specific task, all attached jobs, annotations, and data - api_instance.tasks_destroy(id) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_destroy: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method deletes a specific task, all attached jobs, annotations, and data - api_instance.tasks_destroy(id, x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_destroy: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this task. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | The task has been deleted | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_destroy_annotations** -> tasks_destroy_annotations(id) - -Method deletes all annotations for a specific task - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - id = 1 # int | A unique integer value identifying this task. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method deletes all annotations for a specific task - api_instance.tasks_destroy_annotations(id) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_destroy_annotations: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method deletes all annotations for a specific task - api_instance.tasks_destroy_annotations(id, x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_destroy_annotations: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this task. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | The annotation has been deleted | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_list** -> PaginatedTaskReadList tasks_list() - -Returns a paginated list of tasks according to query parameters (10 tasks per page) - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from cvat_sdk.model.paginated_task_read_list import PaginatedTaskReadList -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - filter = "filter_example" # str | A filter term. Avaliable filter_fields: ['project_name', 'name', 'owner', 'status', 'assignee', 'subset', 'mode', 'dimension', 'id', 'project_id', 'updated_date'] (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - page = 1 # int | A page number within the paginated result set. (optional) - page_size = 1 # int | Number of results to return per page. (optional) - search = "search_example" # str | A search term. Avaliable search_fields: ('project_name', 'name', 'owner', 'status', 'assignee', 'subset', 'mode', 'dimension') (optional) - sort = "sort_example" # str | Which field to use when ordering the results. Avaliable ordering_fields: ['project_name', 'name', 'owner', 'status', 'assignee', 'subset', 'mode', 'dimension', 'id', 'project_id', 'updated_date'] (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Returns a paginated list of tasks according to query parameters (10 tasks per page) - api_response = api_instance.tasks_list(x_organization=x_organization, filter=filter, org=org, org_id=org_id, page=page, page_size=page_size, search=search, sort=sort) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_list: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **filter** | **str**| A filter term. Avaliable filter_fields: ['project_name', 'name', 'owner', 'status', 'assignee', 'subset', 'mode', 'dimension', 'id', 'project_id', 'updated_date'] | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **page** | **int**| A page number within the paginated result set. | [optional] - **page_size** | **int**| Number of results to return per page. | [optional] - **search** | **str**| A search term. Avaliable search_fields: ('project_name', 'name', 'owner', 'status', 'assignee', 'subset', 'mode', 'dimension') | [optional] - **sort** | **str**| Which field to use when ordering the results. Avaliable ordering_fields: ['project_name', 'name', 'owner', 'status', 'assignee', 'subset', 'mode', 'dimension', 'id', 'project_id', 'updated_date'] | [optional] - -### Return type - -[**PaginatedTaskReadList**](PaginatedTaskReadList.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_list_jobs** -> PaginatedJobReadList tasks_list_jobs(id) - -Method returns a list of jobs for a specific task - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from cvat_sdk.model.paginated_job_read_list import PaginatedJobReadList -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - id = 1 # int | A unique integer value identifying this task. - x_organization = "X-Organization_example" # str | (optional) - filter = "filter_example" # str | A filter term. Avaliable filter_fields: ['project_name', 'name', 'owner', 'status', 'assignee', 'subset', 'mode', 'dimension', 'id', 'project_id', 'updated_date'] (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - page = 1 # int | A page number within the paginated result set. (optional) - page_size = 1 # int | Number of results to return per page. (optional) - search = "search_example" # str | A search term. Avaliable search_fields: ('project_name', 'name', 'owner', 'status', 'assignee', 'subset', 'mode', 'dimension') (optional) - sort = "sort_example" # str | Which field to use when ordering the results. Avaliable ordering_fields: ['project_name', 'name', 'owner', 'status', 'assignee', 'subset', 'mode', 'dimension', 'id', 'project_id', 'updated_date'] (optional) - - # example passing only required values which don't have defaults set - try: - # Method returns a list of jobs for a specific task - api_response = api_instance.tasks_list_jobs(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_list_jobs: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns a list of jobs for a specific task - api_response = api_instance.tasks_list_jobs(id, x_organization=x_organization, filter=filter, org=org, org_id=org_id, page=page, page_size=page_size, search=search, sort=sort) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_list_jobs: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this task. | - **x_organization** | **str**| | [optional] - **filter** | **str**| A filter term. Avaliable filter_fields: ['project_name', 'name', 'owner', 'status', 'assignee', 'subset', 'mode', 'dimension', 'id', 'project_id', 'updated_date'] | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **page** | **int**| A page number within the paginated result set. | [optional] - **page_size** | **int**| Number of results to return per page. | [optional] - **search** | **str**| A search term. Avaliable search_fields: ('project_name', 'name', 'owner', 'status', 'assignee', 'subset', 'mode', 'dimension') | [optional] - **sort** | **str**| Which field to use when ordering the results. Avaliable ordering_fields: ['project_name', 'name', 'owner', 'status', 'assignee', 'subset', 'mode', 'dimension', 'id', 'project_id', 'updated_date'] | [optional] - -### Return type - -[**PaginatedJobReadList**](PaginatedJobReadList.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_partial_update** -> TaskWrite tasks_partial_update(id) - -Methods does a partial update of chosen fields in a task - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from cvat_sdk.model.task_write import TaskWrite -from cvat_sdk.model.patched_task_write_request import PatchedTaskWriteRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - id = 1 # int | A unique integer value identifying this task. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - patched_task_write_request = PatchedTaskWriteRequest( - name="name_example", - project_id=1, - owner_id=1, - assignee_id=1, - bug_tracker="bug_tracker_example", - overlap=1, - segment_size=1, - labels=[ - PatchedLabelRequest( - id=1, - name="name_example", - color="color_example", - attributes=[ - AttributeRequest( - name="name_example", - mutable=True, - input_type=InputTypeEnum("checkbox"), - default_value="default_value_example", - values=[ - "values_example", - ], - ), - ], - deleted=True, - ), - ], - subset="subset_example", - target_storage=PatchedTaskWriteRequestTargetStorage(None), - source_storage=PatchedTaskWriteRequestTargetStorage(None), - ) # PatchedTaskWriteRequest | (optional) - - # example passing only required values which don't have defaults set - try: - # Methods does a partial update of chosen fields in a task - api_response = api_instance.tasks_partial_update(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_partial_update: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Methods does a partial update of chosen fields in a task - api_response = api_instance.tasks_partial_update(id, x_organization=x_organization, org=org, org_id=org_id, patched_task_write_request=patched_task_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_partial_update: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this task. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **patched_task_write_request** | [**PatchedTaskWriteRequest**](PatchedTaskWriteRequest.md)| | [optional] - -### Return type - -[**TaskWrite**](TaskWrite.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_partial_update_annotations** -> TaskWrite tasks_partial_update_annotations(action, id) - -Method performs a partial update of annotations in a specific task - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from cvat_sdk.model.task_write import TaskWrite -from cvat_sdk.model.patched_task_write_request import PatchedTaskWriteRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - action = "create" # str | - id = 1 # int | A unique integer value identifying this task. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - patched_task_write_request = PatchedTaskWriteRequest( - name="name_example", - project_id=1, - owner_id=1, - assignee_id=1, - bug_tracker="bug_tracker_example", - overlap=1, - segment_size=1, - labels=[ - PatchedLabelRequest( - id=1, - name="name_example", - color="color_example", - attributes=[ - AttributeRequest( - name="name_example", - mutable=True, - input_type=InputTypeEnum("checkbox"), - default_value="default_value_example", - values=[ - "values_example", - ], - ), - ], - deleted=True, - ), - ], - subset="subset_example", - target_storage=PatchedTaskWriteRequestTargetStorage(None), - source_storage=PatchedTaskWriteRequestTargetStorage(None), - ) # PatchedTaskWriteRequest | (optional) - - # example passing only required values which don't have defaults set - try: - # Method performs a partial update of annotations in a specific task - api_response = api_instance.tasks_partial_update_annotations(action, id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_partial_update_annotations: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method performs a partial update of annotations in a specific task - api_response = api_instance.tasks_partial_update_annotations(action, id, x_organization=x_organization, org=org, org_id=org_id, patched_task_write_request=patched_task_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_partial_update_annotations: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **action** | **str**| | - **id** | **int**| A unique integer value identifying this task. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **patched_task_write_request** | [**PatchedTaskWriteRequest**](PatchedTaskWriteRequest.md)| | [optional] - -### Return type - -[**TaskWrite**](TaskWrite.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_partial_update_annotations_file** -> tasks_partial_update_annotations_file(file_id, id) - -Allows to upload an annotation file chunk. Implements TUS file uploading protocol. - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - file_id = "bf325375-e030-fccb-a009-17317c574773" # str | - id = 1 # int | A unique integer value identifying this task. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - body = open('/path/to/file', 'rb') # file_type | (optional) - - # example passing only required values which don't have defaults set - try: - # Allows to upload an annotation file chunk. Implements TUS file uploading protocol. - api_instance.tasks_partial_update_annotations_file(file_id, id) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_partial_update_annotations_file: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Allows to upload an annotation file chunk. Implements TUS file uploading protocol. - api_instance.tasks_partial_update_annotations_file(file_id, id, x_organization=x_organization, org=org, org_id=org_id, body=body) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_partial_update_annotations_file: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file_id** | **str**| | - **id** | **int**| A unique integer value identifying this task. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **body** | **file_type**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: Not defined - - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_partial_update_backup_file** -> tasks_partial_update_backup_file(file_id) - -Allows to upload a file chunk. Implements TUS file uploading protocol. - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - file_id = "bf325375-e030-fccb-a009-17317c574773" # str | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - body = open('/path/to/file', 'rb') # file_type | (optional) - - # example passing only required values which don't have defaults set - try: - # Allows to upload a file chunk. Implements TUS file uploading protocol. - api_instance.tasks_partial_update_backup_file(file_id) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_partial_update_backup_file: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Allows to upload a file chunk. Implements TUS file uploading protocol. - api_instance.tasks_partial_update_backup_file(file_id, x_organization=x_organization, org=org, org_id=org_id, body=body) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_partial_update_backup_file: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file_id** | **str**| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **body** | **file_type**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: Not defined - - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_partial_update_data_file** -> tasks_partial_update_data_file(file_id, id) - -Allows to upload a file chunk. Implements TUS file uploading protocol. - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - file_id = "bf325375-e030-fccb-a009-17317c574773" # str | - id = 1 # int | A unique integer value identifying this task. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - body = open('/path/to/file', 'rb') # file_type | (optional) - - # example passing only required values which don't have defaults set - try: - # Allows to upload a file chunk. Implements TUS file uploading protocol. - api_instance.tasks_partial_update_data_file(file_id, id) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_partial_update_data_file: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Allows to upload a file chunk. Implements TUS file uploading protocol. - api_instance.tasks_partial_update_data_file(file_id, id, x_organization=x_organization, org=org, org_id=org_id, body=body) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_partial_update_data_file: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file_id** | **str**| | - **id** | **int**| A unique integer value identifying this task. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **body** | **file_type**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: Not defined - - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_partial_update_data_meta** -> DataMetaRead tasks_partial_update_data_meta(id) - -Method provides a meta information about media files which are related with the task - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from cvat_sdk.model.patched_task_write_request import PatchedTaskWriteRequest -from cvat_sdk.model.data_meta_read import DataMetaRead -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - id = 1 # int | A unique integer value identifying this task. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - patched_task_write_request = PatchedTaskWriteRequest( - name="name_example", - project_id=1, - owner_id=1, - assignee_id=1, - bug_tracker="bug_tracker_example", - overlap=1, - segment_size=1, - labels=[ - PatchedLabelRequest( - id=1, - name="name_example", - color="color_example", - attributes=[ - AttributeRequest( - name="name_example", - mutable=True, - input_type=InputTypeEnum("checkbox"), - default_value="default_value_example", - values=[ - "values_example", - ], - ), - ], - deleted=True, - ), - ], - subset="subset_example", - target_storage=PatchedTaskWriteRequestTargetStorage(None), - source_storage=PatchedTaskWriteRequestTargetStorage(None), - ) # PatchedTaskWriteRequest | (optional) - - # example passing only required values which don't have defaults set - try: - # Method provides a meta information about media files which are related with the task - api_response = api_instance.tasks_partial_update_data_meta(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_partial_update_data_meta: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method provides a meta information about media files which are related with the task - api_response = api_instance.tasks_partial_update_data_meta(id, x_organization=x_organization, org=org, org_id=org_id, patched_task_write_request=patched_task_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_partial_update_data_meta: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this task. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **patched_task_write_request** | [**PatchedTaskWriteRequest**](PatchedTaskWriteRequest.md)| | [optional] - -### Return type - -[**DataMetaRead**](DataMetaRead.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_retrieve** -> TaskRead tasks_retrieve(id) - -Method returns details of a specific task - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from cvat_sdk.model.task_read import TaskRead -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - id = 1 # int | A unique integer value identifying this task. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method returns details of a specific task - api_response = api_instance.tasks_retrieve(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_retrieve: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns details of a specific task - api_response = api_instance.tasks_retrieve(id, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_retrieve: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this task. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**TaskRead**](TaskRead.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_retrieve_annotations** -> tasks_retrieve_annotations(id) - -Method allows to download task annotations - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - id = 1 # int | A unique integer value identifying this task. - x_organization = "X-Organization_example" # str | (optional) - action = "download" # str | Used to start downloading process after annotation file had been created (optional) if omitted the server will use the default value of "download" - cloud_storage_id = 3.14 # float | Storage id (optional) - filename = "filename_example" # str | Desired output file name (optional) - format = "format_example" # str | Desired output format name You can get the list of supported formats at: /server/annotation/formats (optional) - location = "cloud_storage" # str | Where need to save downloaded dataset (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - use_default_location = True # bool | Use the location that was configured in the task to export annotation (optional) if omitted the server will use the default value of True - - # example passing only required values which don't have defaults set - try: - # Method allows to download task annotations - api_instance.tasks_retrieve_annotations(id) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_retrieve_annotations: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method allows to download task annotations - api_instance.tasks_retrieve_annotations(id, x_organization=x_organization, action=action, cloud_storage_id=cloud_storage_id, filename=filename, format=format, location=location, org=org, org_id=org_id, use_default_location=use_default_location) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_retrieve_annotations: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this task. | - **x_organization** | **str**| | [optional] - **action** | **str**| Used to start downloading process after annotation file had been created | [optional] if omitted the server will use the default value of "download" - **cloud_storage_id** | **float**| Storage id | [optional] - **filename** | **str**| Desired output file name | [optional] - **format** | **str**| Desired output format name You can get the list of supported formats at: /server/annotation/formats | [optional] - **location** | **str**| Where need to save downloaded dataset | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **use_default_location** | **bool**| Use the location that was configured in the task to export annotation | [optional] if omitted the server will use the default value of True - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Download of file started | - | -**201** | Annotations file is ready to download | - | -**202** | Dump of annotations has been started | - | -**405** | Format is not available | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_retrieve_backup** -> tasks_retrieve_backup(id) - -Method backup a specified task - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - id = 1 # int | A unique integer value identifying this task. - x_organization = "X-Organization_example" # str | (optional) - action = "download" # str | Used to start downloading process after backup file had been created (optional) if omitted the server will use the default value of "download" - cloud_storage_id = 3.14 # float | Storage id (optional) - filename = "filename_example" # str | Backup file name (optional) - location = "cloud_storage" # str | Where need to save downloaded backup (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - use_default_location = True # bool | Use the location that was configured in the task to export backup (optional) if omitted the server will use the default value of True - - # example passing only required values which don't have defaults set - try: - # Method backup a specified task - api_instance.tasks_retrieve_backup(id) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_retrieve_backup: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method backup a specified task - api_instance.tasks_retrieve_backup(id, x_organization=x_organization, action=action, cloud_storage_id=cloud_storage_id, filename=filename, location=location, org=org, org_id=org_id, use_default_location=use_default_location) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_retrieve_backup: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this task. | - **x_organization** | **str**| | [optional] - **action** | **str**| Used to start downloading process after backup file had been created | [optional] if omitted the server will use the default value of "download" - **cloud_storage_id** | **float**| Storage id | [optional] - **filename** | **str**| Backup file name | [optional] - **location** | **str**| Where need to save downloaded backup | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **use_default_location** | **bool**| Use the location that was configured in the task to export backup | [optional] if omitted the server will use the default value of True - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Download of file started | - | -**201** | Output backup file is ready for downloading | - | -**202** | Creating a backup file has been started | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_retrieve_data** -> tasks_retrieve_data(id, number, quality, type) - -Method returns data for a specific task - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - id = 1 # int | A unique integer value identifying this task. - number = 1 # int | A unique number value identifying chunk or frame, doesn't matter for 'preview' type - quality = "compressed" # str | Specifies the quality level of the requested data, doesn't matter for 'preview' type - type = "chunk" # str | Specifies the type of the requested data - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method returns data for a specific task - api_instance.tasks_retrieve_data(id, number, quality, type) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_retrieve_data: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns data for a specific task - api_instance.tasks_retrieve_data(id, number, quality, type, x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_retrieve_data: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this task. | - **number** | **int**| A unique number value identifying chunk or frame, doesn't matter for 'preview' type | - **quality** | **str**| Specifies the quality level of the requested data, doesn't matter for 'preview' type | - **type** | **str**| Specifies the type of the requested data | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Data of a specific type | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_retrieve_data_meta** -> DataMetaRead tasks_retrieve_data_meta(id) - -Method provides a meta information about media files which are related with the task - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from cvat_sdk.model.data_meta_read import DataMetaRead -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - id = 1 # int | A unique integer value identifying this task. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method provides a meta information about media files which are related with the task - api_response = api_instance.tasks_retrieve_data_meta(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_retrieve_data_meta: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method provides a meta information about media files which are related with the task - api_response = api_instance.tasks_retrieve_data_meta(id, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_retrieve_data_meta: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this task. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**DataMetaRead**](DataMetaRead.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_retrieve_dataset** -> tasks_retrieve_dataset(format, id) - -Export task as a dataset in a specific format - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - format = "format_example" # str | Desired output format name You can get the list of supported formats at: /server/annotation/formats - id = 1 # int | A unique integer value identifying this task. - x_organization = "X-Organization_example" # str | (optional) - action = "download" # str | Used to start downloading process after annotation file had been created (optional) if omitted the server will use the default value of "download" - cloud_storage_id = 3.14 # float | Storage id (optional) - filename = "filename_example" # str | Desired output file name (optional) - location = "cloud_storage" # str | Where need to save downloaded dataset (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - use_default_location = True # bool | Use the location that was configured in task to export annotations (optional) if omitted the server will use the default value of True - - # example passing only required values which don't have defaults set - try: - # Export task as a dataset in a specific format - api_instance.tasks_retrieve_dataset(format, id) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_retrieve_dataset: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Export task as a dataset in a specific format - api_instance.tasks_retrieve_dataset(format, id, x_organization=x_organization, action=action, cloud_storage_id=cloud_storage_id, filename=filename, location=location, org=org, org_id=org_id, use_default_location=use_default_location) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_retrieve_dataset: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **format** | **str**| Desired output format name You can get the list of supported formats at: /server/annotation/formats | - **id** | **int**| A unique integer value identifying this task. | - **x_organization** | **str**| | [optional] - **action** | **str**| Used to start downloading process after annotation file had been created | [optional] if omitted the server will use the default value of "download" - **cloud_storage_id** | **float**| Storage id | [optional] - **filename** | **str**| Desired output file name | [optional] - **location** | **str**| Where need to save downloaded dataset | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **use_default_location** | **bool**| Use the location that was configured in task to export annotations | [optional] if omitted the server will use the default value of True - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Download of file started | - | -**201** | Output file is ready for downloading | - | -**202** | Exporting has been started | - | -**405** | Format is not available | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_retrieve_status** -> RqStatus tasks_retrieve_status(id) - -When task is being created the method returns information about a status of the creation process - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from cvat_sdk.model.rq_status import RqStatus -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - id = 1 # int | A unique integer value identifying this task. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # When task is being created the method returns information about a status of the creation process - api_response = api_instance.tasks_retrieve_status(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_retrieve_status: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # When task is being created the method returns information about a status of the creation process - api_response = api_instance.tasks_retrieve_status(id, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_retrieve_status: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this task. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**RqStatus**](RqStatus.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_update** -> TaskWrite tasks_update(id, task_write_request) - -Method updates a task by id - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from cvat_sdk.model.task_write import TaskWrite -from cvat_sdk.model.task_write_request import TaskWriteRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - id = 1 # int | A unique integer value identifying this task. - task_write_request = TaskWriteRequest( - name="name_example", - project_id=1, - owner_id=1, - assignee_id=1, - bug_tracker="bug_tracker_example", - overlap=1, - segment_size=1, - labels=[ - PatchedLabelRequest( - id=1, - name="name_example", - color="color_example", - attributes=[ - AttributeRequest( - name="name_example", - mutable=True, - input_type=InputTypeEnum("checkbox"), - default_value="default_value_example", - values=[ - "values_example", - ], - ), - ], - deleted=True, - ), - ], - subset="subset_example", - target_storage=PatchedTaskWriteRequestTargetStorage(None), - source_storage=PatchedTaskWriteRequestTargetStorage(None), - ) # TaskWriteRequest | - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method updates a task by id - api_response = api_instance.tasks_update(id, task_write_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_update: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method updates a task by id - api_response = api_instance.tasks_update(id, task_write_request, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_update: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this task. | - **task_write_request** | [**TaskWriteRequest**](TaskWriteRequest.md)| | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**TaskWrite**](TaskWrite.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tasks_update_annotations** -> tasks_update_annotations(id, task_write_request) - -Method allows to upload task annotations - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import tasks_api -from cvat_sdk.model.task_write_request import TaskWriteRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = tasks_api.TasksApi(api_client) - id = 1 # int | A unique integer value identifying this task. - task_write_request = TaskWriteRequest( - name="name_example", - project_id=1, - owner_id=1, - assignee_id=1, - bug_tracker="bug_tracker_example", - overlap=1, - segment_size=1, - labels=[ - PatchedLabelRequest( - id=1, - name="name_example", - color="color_example", - attributes=[ - AttributeRequest( - name="name_example", - mutable=True, - input_type=InputTypeEnum("checkbox"), - default_value="default_value_example", - values=[ - "values_example", - ], - ), - ], - deleted=True, - ), - ], - subset="subset_example", - target_storage=PatchedTaskWriteRequestTargetStorage(None), - source_storage=PatchedTaskWriteRequestTargetStorage(None), - ) # TaskWriteRequest | - x_organization = "X-Organization_example" # str | (optional) - format = "format_example" # str | Input format name You can get the list of supported formats at: /server/annotation/formats (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method allows to upload task annotations - api_instance.tasks_update_annotations(id, task_write_request) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_update_annotations: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method allows to upload task annotations - api_instance.tasks_update_annotations(id, task_write_request, x_organization=x_organization, format=format, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling TasksApi->tasks_update_annotations: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this task. | - **task_write_request** | [**TaskWriteRequest**](TaskWriteRequest.md)| | - **x_organization** | **str**| | [optional] - **format** | **str**| Input format name You can get the list of supported formats at: /server/annotation/formats | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | Uploading has finished | - | -**202** | Uploading has been started | - | -**405** | Format is not available | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/cvat-sdk/docs/Token.md b/cvat-sdk/docs/Token.md deleted file mode 100644 index fa22e45b..00000000 --- a/cvat-sdk/docs/Token.md +++ /dev/null @@ -1,13 +0,0 @@ -# Token - -Serializer for Token model. - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**key** | **str** | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/TrackedShape.md b/cvat-sdk/docs/TrackedShape.md deleted file mode 100644 index eb1af046..00000000 --- a/cvat-sdk/docs/TrackedShape.md +++ /dev/null @@ -1,20 +0,0 @@ -# TrackedShape - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | [**ShapeType**](ShapeType.md) | | -**occluded** | **bool** | | -**points** | **[float]** | | -**frame** | **int** | | -**outside** | **bool** | | -**attributes** | [**[AttributeVal]**](AttributeVal.md) | | -**z_order** | **int** | | [optional] if omitted the server will use the default value of 0 -**rotation** | **float** | | [optional] if omitted the server will use the default value of 0.0 -**id** | **int, none_type** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/User.md b/cvat-sdk/docs/User.md deleted file mode 100644 index 06e2865d..00000000 --- a/cvat-sdk/docs/User.md +++ /dev/null @@ -1,23 +0,0 @@ -# User - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**username** | **str** | Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. | -**groups** | **[str]** | | -**url** | **str** | | [optional] [readonly] -**id** | **int** | | [optional] [readonly] -**first_name** | **str** | | [optional] -**last_name** | **str** | | [optional] -**email** | **str** | | [optional] -**is_staff** | **bool** | Designates whether the user can log into this admin site. | [optional] -**is_superuser** | **bool** | Designates that this user has all permissions without explicitly assigning them. | [optional] -**is_active** | **bool** | Designates whether this user should be treated as active. Unselect this instead of deleting accounts. | [optional] -**last_login** | **datetime** | | [optional] [readonly] -**date_joined** | **datetime** | | [optional] [readonly] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/UserAgreement.md b/cvat-sdk/docs/UserAgreement.md deleted file mode 100644 index f8a932fe..00000000 --- a/cvat-sdk/docs/UserAgreement.md +++ /dev/null @@ -1,16 +0,0 @@ -# UserAgreement - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | -**display_text** | **str** | | [optional] if omitted the server will use the default value of "" -**url** | **str** | | [optional] if omitted the server will use the default value of "" -**required** | **bool** | | [optional] if omitted the server will use the default value of False -**value** | **bool** | | [optional] if omitted the server will use the default value of False -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/UserAgreementRequest.md b/cvat-sdk/docs/UserAgreementRequest.md deleted file mode 100644 index 03bf39c9..00000000 --- a/cvat-sdk/docs/UserAgreementRequest.md +++ /dev/null @@ -1,16 +0,0 @@ -# UserAgreementRequest - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | -**display_text** | **str** | | [optional] if omitted the server will use the default value of "" -**url** | **str** | | [optional] if omitted the server will use the default value of "" -**required** | **bool** | | [optional] if omitted the server will use the default value of False -**value** | **bool** | | [optional] if omitted the server will use the default value of False -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/cvat-sdk/docs/UsersApi.md b/cvat-sdk/docs/UsersApi.md deleted file mode 100644 index fb6face8..00000000 --- a/cvat-sdk/docs/UsersApi.md +++ /dev/null @@ -1,576 +0,0 @@ -# cvat_sdk.UsersApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**users_destroy**](UsersApi.md#users_destroy) | **DELETE** /api/users/{id} | Method deletes a specific user from the server -[**users_list**](UsersApi.md#users_list) | **GET** /api/users | Method provides a paginated list of users registered on the server -[**users_partial_update**](UsersApi.md#users_partial_update) | **PATCH** /api/users/{id} | Method updates chosen fields of a user -[**users_retrieve**](UsersApi.md#users_retrieve) | **GET** /api/users/{id} | Method provides information of a specific user -[**users_retrieve_self**](UsersApi.md#users_retrieve_self) | **GET** /api/users/self | Method returns an instance of a user who is currently authorized - - -# **users_destroy** -> users_destroy(id) - -Method deletes a specific user from the server - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import users_api -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = users_api.UsersApi(api_client) - id = 1 # int | A unique integer value identifying this user. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method deletes a specific user from the server - api_instance.users_destroy(id) - except cvat_sdk.ApiException as e: - print("Exception when calling UsersApi->users_destroy: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method deletes a specific user from the server - api_instance.users_destroy(id, x_organization=x_organization, org=org, org_id=org_id) - except cvat_sdk.ApiException as e: - print("Exception when calling UsersApi->users_destroy: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this user. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | The user has been deleted | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **users_list** -> PaginatedMetaUserList users_list() - -Method provides a paginated list of users registered on the server - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import users_api -from cvat_sdk.model.paginated_meta_user_list import PaginatedMetaUserList -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = users_api.UsersApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - filter = "filter_example" # str | A filter term. Avaliable filter_fields: ('id', 'is_active', 'username') (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - page = 1 # int | A page number within the paginated result set. (optional) - page_size = 1 # int | Number of results to return per page. (optional) - search = "search_example" # str | A search term. Avaliable search_fields: ('username', 'first_name', 'last_name') (optional) - sort = "sort_example" # str | Which field to use when ordering the results. Avaliable ordering_fields: ('id', 'is_active', 'username') (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method provides a paginated list of users registered on the server - api_response = api_instance.users_list(x_organization=x_organization, filter=filter, org=org, org_id=org_id, page=page, page_size=page_size, search=search, sort=sort) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling UsersApi->users_list: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **filter** | **str**| A filter term. Avaliable filter_fields: ('id', 'is_active', 'username') | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **page** | **int**| A page number within the paginated result set. | [optional] - **page_size** | **int**| Number of results to return per page. | [optional] - **search** | **str**| A search term. Avaliable search_fields: ('username', 'first_name', 'last_name') | [optional] - **sort** | **str**| Which field to use when ordering the results. Avaliable ordering_fields: ('id', 'is_active', 'username') | [optional] - -### Return type - -[**PaginatedMetaUserList**](PaginatedMetaUserList.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **users_partial_update** -> MetaUser users_partial_update(id) - -Method updates chosen fields of a user - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import users_api -from cvat_sdk.model.meta_user import MetaUser -from cvat_sdk.model.patched_user_request import PatchedUserRequest -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = users_api.UsersApi(api_client) - id = 1 # int | A unique integer value identifying this user. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - patched_user_request = PatchedUserRequest( - username="A", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - groups=[ - "groups_example", - ], - is_staff=True, - is_superuser=True, - is_active=True, - ) # PatchedUserRequest | (optional) - - # example passing only required values which don't have defaults set - try: - # Method updates chosen fields of a user - api_response = api_instance.users_partial_update(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling UsersApi->users_partial_update: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method updates chosen fields of a user - api_response = api_instance.users_partial_update(id, x_organization=x_organization, org=org, org_id=org_id, patched_user_request=patched_user_request) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling UsersApi->users_partial_update: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this user. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - **patched_user_request** | [**PatchedUserRequest**](PatchedUserRequest.md)| | [optional] - -### Return type - -[**MetaUser**](MetaUser.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data, application/offset+octet-stream - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **users_retrieve** -> MetaUser users_retrieve(id) - -Method provides information of a specific user - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import users_api -from cvat_sdk.model.meta_user import MetaUser -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = users_api.UsersApi(api_client) - id = 1 # int | A unique integer value identifying this user. - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - try: - # Method provides information of a specific user - api_response = api_instance.users_retrieve(id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling UsersApi->users_retrieve: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method provides information of a specific user - api_response = api_instance.users_retrieve(id, x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling UsersApi->users_retrieve: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **int**| A unique integer value identifying this user. | - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**MetaUser**](MetaUser.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **users_retrieve_self** -> MetaUser users_retrieve_self() - -Method returns an instance of a user who is currently authorized - -Method returns an instance of a user who is currently authorized - -### Example - -* Api Key Authentication (SignatureAuthentication): -* Basic Authentication (basicAuth): -* Api Key Authentication (cookieAuth): -* Api Key Authentication (tokenAuth): - -```python -import time -import cvat_sdk -from cvat_sdk.api import users_api -from cvat_sdk.model.meta_user import MetaUser -from pprint import pprint -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = cvat_sdk.Configuration( - host = "http://localhost" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure API key authorization: SignatureAuthentication -configuration.api_key['SignatureAuthentication'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['SignatureAuthentication'] = 'Bearer' - -# Configure HTTP basic authorization: basicAuth -configuration = cvat_sdk.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookieAuth -configuration.api_key['cookieAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookieAuth'] = 'Bearer' - -# Configure API key authorization: tokenAuth -configuration.api_key['tokenAuth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['tokenAuth'] = 'Bearer' - -# Enter a context with an instance of the API client -with cvat_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = users_api.UsersApi(api_client) - x_organization = "X-Organization_example" # str | (optional) - org = "org_example" # str | Organization unique slug (optional) - org_id = 1 # int | Organization identifier (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Method returns an instance of a user who is currently authorized - api_response = api_instance.users_retrieve_self(x_organization=x_organization, org=org, org_id=org_id) - pprint(api_response) - except cvat_sdk.ApiException as e: - print("Exception when calling UsersApi->users_retrieve_self: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **x_organization** | **str**| | [optional] - **org** | **str**| Organization unique slug | [optional] - **org_id** | **int**| Organization identifier | [optional] - -### Return type - -[**MetaUser**](MetaUser.md) - -### Authorization - -[SignatureAuthentication](../README.md#SignatureAuthentication), [basicAuth](../README.md#basicAuth), [cookieAuth](../README.md#cookieAuth), [tokenAuth](../README.md#tokenAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/vnd.cvat+json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/cvat-sdk/gen/generate.sh b/cvat-sdk/gen/generate.sh index ad7f2dfd..1dc44d96 100755 --- a/cvat-sdk/gen/generate.sh +++ b/cvat-sdk/gen/generate.sh @@ -1,33 +1,38 @@ #!/bin/sh +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + set -e +GENERATOR_VERSION="v6.0.1" + VERSION="2.0-alpha" LIB_NAME="cvat_sdk" +LAYER1_LIB_NAME="${LIB_NAME}/api_client" DST_DIR="." TEMPLATE_DIR="gen" PYTHON_POST_PROCESS_FILE="${TEMPLATE_DIR}/postprocess.py" mkdir -p "${DST_DIR}/" -rm -f -r "${DST_DIR}/docs/" "${DST_DIR}/${LIB_NAME}" +rm -f -r "${DST_DIR}/docs" "${DST_DIR}/${LAYER1_LIB_NAME}" "requirements/" cp "${TEMPLATE_DIR}/templates/openapi-generator/.openapi-generator-ignore" "${DST_DIR}/" # Pass template dir here # https://github.com/OpenAPITools/openapi-generator/issues/8420 -docker run --rm -v "$PWD":"/local" \ - openapitools/openapi-generator-cli generate \ +docker run --rm -v "$PWD":"/local" -u "$(id -u)":"$(id -g)" \ + openapitools/openapi-generator-cli:${GENERATOR_VERSION} generate \ -t "/local/${TEMPLATE_DIR}/templates/openapi-generator/" \ -i "/local/schema/schema.yml" \ --config "/local/${TEMPLATE_DIR}/generator-config.yml" \ -g python \ -o "/local/${DST_DIR}/" -sudo chown -R "$(id -u)":"$(id -g)" "${DST_DIR}/" sed -e "s|{{packageVersion}}|${VERSION}|g" "${TEMPLATE_DIR}/templates/version.py.template" > "${DST_DIR}/${LIB_NAME}/version.py" -cp -r "${TEMPLATE_DIR}/templates/requirements/" "${DST_DIR}/" +cp -r "${TEMPLATE_DIR}/templates/requirements" "${DST_DIR}/" cp -r "${TEMPLATE_DIR}/templates/MANIFEST.in" "${DST_DIR}/" +mv "${DST_DIR}/requirements.txt" "${DST_DIR}/requirements/api_client.txt" # Do custom postprocessing "${PYTHON_POST_PROCESS_FILE}" --schema "schema/schema.yml" --input-path "${DST_DIR}/${LIB_NAME}" -black --config pyproject.toml "${DST_DIR}/${LIB_NAME}" -isort --sp pyproject.toml "${DST_DIR}/${LIB_NAME}" diff --git a/cvat-sdk/gen/generator-config.yml b/cvat-sdk/gen/generator-config.yml index d9d9b1f9..614ecb3c 100644 --- a/cvat-sdk/gen/generator-config.yml +++ b/cvat-sdk/gen/generator-config.yml @@ -1,7 +1,8 @@ additionalProperties: + projectName: "cvat_sdk" packageVersion: "2.0-alpha" packageUrl: "https://github.com/cvat-ai/cvat" - packageName: "cvat_sdk" + packageName: "cvat_sdk.api_client" initRequiredVars: true generateSourceCodeOnly: false generatorLanguageVersion: '>=3.7' diff --git a/cvat-sdk/gen/postprocess.py b/cvat-sdk/gen/postprocess.py index 2a06ad8d..51661520 100755 --- a/cvat-sdk/gen/postprocess.py +++ b/cvat-sdk/gen/postprocess.py @@ -1,4 +1,5 @@ #!/usr/bin/env python + # Copyright (C) 2022 Intel Corporation # # SPDX-License-Identifier: MIT @@ -18,8 +19,11 @@ def collect_operations(schema): operations = {} - for _, endpoint_schema in endpoints.items(): - for _, method_schema in endpoint_schema.items(): + for endpoint_name, endpoint_schema in endpoints.items(): + for method_name, method_schema in endpoint_schema.items(): + method_schema = dict(method_schema) + method_schema["method"] = method_name + method_schema["endpoint"] = endpoint_name operations[method_schema["operationId"]] = method_schema return operations @@ -37,11 +41,15 @@ class Processor: operation = self._operations[name] new_name = name - for tag in operation.get("tags", []): - prefix = tag + "_" - if new_name.startswith(prefix): - new_name = new_name[len(prefix) :] - break + + tokenized_path = operation["endpoint"].split("/") + assert 3 <= len(tokenized_path) + assert tokenized_path[0] == "" and tokenized_path[1] == "api" + tokenized_path = tokenized_path[2:] + + prefix = tokenized_path[0] + "_" + if new_name.startswith(prefix): + new_name = new_name[len(prefix) :] return new_name diff --git a/cvat-sdk/gen/requirements.txt b/cvat-sdk/gen/requirements.txt new file mode 100644 index 00000000..f20a92b8 --- /dev/null +++ b/cvat-sdk/gen/requirements.txt @@ -0,0 +1,6 @@ +# can't have a dependency on base.txt, because it depends on the generated file + +black>=22.1.0 +inflection >= 0.5.1 +isort>=5.10.1 +ruamel.yaml>=0.17.21 diff --git a/cvat-sdk/gen/templates/openapi-generator/.openapi-generator-ignore b/cvat-sdk/gen/templates/openapi-generator/.openapi-generator-ignore index 907f89d7..44b0733a 100644 --- a/cvat-sdk/gen/templates/openapi-generator/.openapi-generator-ignore +++ b/cvat-sdk/gen/templates/openapi-generator/.openapi-generator-ignore @@ -23,14 +23,18 @@ #!docs/README.md # For safety +/cvat_sdk/__init__.py /config /gen +/helpers.py +/utils.py +/types.py # Don't generate these files /git_push.sh -/requirements.txt /setup.cfg /test-requirements.txt /tox.ini /.gitlab-ci.yml -/.travis.yml \ No newline at end of file +/.travis.yml +/.gitignore diff --git a/cvat-sdk/gen/templates/openapi-generator/__init__models.mustache b/cvat-sdk/gen/templates/openapi-generator/__init__models.mustache index bcb01308..9231ab23 100644 --- a/cvat-sdk/gen/templates/openapi-generator/__init__models.mustache +++ b/cvat-sdk/gen/templates/openapi-generator/__init__models.mustache @@ -11,6 +11,6 @@ {{#models}} {{#model}} -from {{modelPackage}}.{{classFilename}} import {{classname}} +from {{modelPackage}}.{{classFilename}} import {{classname}}{{^interfaces}}, I{{classname}}{{/interfaces}} {{/model}} {{/models}} diff --git a/cvat-sdk/gen/templates/openapi-generator/__init__package.mustache b/cvat-sdk/gen/templates/openapi-generator/__init__package.mustache index ad053d42..91e318ad 100644 --- a/cvat-sdk/gen/templates/openapi-generator/__init__package.mustache +++ b/cvat-sdk/gen/templates/openapi-generator/__init__package.mustache @@ -1,17 +1,14 @@ {{>partial_header}} -from .version import VERSION as __version__ +__version__ = "{{packageVersion}}" -# import ApiClient from {{packageName}}.api_client import ApiClient -# import Configuration from {{packageName}}.configuration import Configuration {{#hasHttpSignatureMethods}} from {{packageName}}.signing import HttpSigningConfiguration {{/hasHttpSignatureMethods}} -# import exceptions from {{packageName}}.exceptions import OpenApiException from {{packageName}}.exceptions import ApiAttributeError from {{packageName}}.exceptions import ApiTypeError diff --git a/cvat-sdk/gen/templates/openapi-generator/api.mustache b/cvat-sdk/gen/templates/openapi-generator/api.mustache index 31580966..160d641b 100644 --- a/cvat-sdk/gen/templates/openapi-generator/api.mustache +++ b/cvat-sdk/gen/templates/openapi-generator/api.mustache @@ -21,8 +21,8 @@ from {{packageName}}.model_utils import ( # noqa: F401 from typing import TYPE_CHECKING if TYPE_CHECKING: # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * + from {{packageName}}.apis import * + from {{packageName}}.models import * class {{classname}}(object): diff --git a/cvat-sdk/gen/templates/openapi-generator/api_client.mustache b/cvat-sdk/gen/templates/openapi-generator/api_client.mustache index ba7cc507..537cd1cc 100644 --- a/cvat-sdk/gen/templates/openapi-generator/api_client.mustache +++ b/cvat-sdk/gen/templates/openapi-generator/api_client.mustache @@ -11,6 +11,7 @@ import io import os import re import typing +from http.cookies import SimpleCookie from urllib.parse import quote from urllib3 import HTTPResponse from urllib3.fields import RequestField @@ -34,14 +35,16 @@ from {{packageName}}.model_utils import ( file_type, model_to_dict, none_type, - validate_and_convert_types + validate_and_convert_types, + to_json, + get_file_data_and_close_file, ) from typing import TYPE_CHECKING if TYPE_CHECKING: # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * + from {{packageName}}.apis import * + from {{packageName}}.models import * class ApiClient(object): @@ -63,15 +66,15 @@ class ApiClient(object): _pool = None - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): + def __init__(self, + configuration: typing.Optional[Configuration] = None, + headers: typing.Optional[typing.Dict[str, str]] = None, + cookies: typing.Optional[typing.Dict[str, str]] = None, + pool_threads: int = 1): """ :param configuration: configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API + :param headers: header to include when making calls to the API + :param cookies: cookies to include when making calls to the API :param pool_threads: The number of threads to use for async requests to the API. More threads means more concurrent API requests. """ @@ -82,10 +85,10 @@ class ApiClient(object): self.pool_threads = pool_threads self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie + self.default_headers: typing.Dict[str, str] = headers or {} + self.cookies = SimpleCookie() + if cookies: + self.cookies.update(cookies) # Set default User-Agent. self.user_agent = '{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/python{{/httpUserAgent}}' @@ -180,9 +183,7 @@ class ApiClient(object): # header parameters header_params = header_params or {} - header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie + header_params.update(self.get_common_headers()) if header_params: header_params = self.sanitize_for_serialization(header_params) header_params = dict(self.parameters_to_tuples(header_params, @@ -253,12 +254,15 @@ class ApiClient(object): self.last_response = response return_data = None - if _parse_response and response_schema: - return_data = self.deserialize( - response, - response_schema, - _check_type=_check_type - ) + if _parse_response: + self._update_cookies_from_response(response) + + if response_schema: + return_data = self.deserialize( + response, + response_schema, + _check_type=_check_type + ) {{#tornado}} raise tornado.gen.Return((return_data, response)) @@ -267,6 +271,20 @@ class ApiClient(object): return (return_data, response) {{/tornado}} + def get_common_headers(self) -> typing.Dict[str, str]: + """ + Returns a headers dict with all the required headers for requests + """ + + headers = {} + headers.update(self.default_headers) + if self.cookies: + headers['Cookie'] = self.cookies.output(attrs=[], header="", sep=";").strip() + return headers + + def _update_cookies_from_response(self, response: HTTPResponse): + self.cookies.update(SimpleCookie(response.getheader("Set-Cookie"))) + def parameters_to_multipart(self, params, collection_types): """Get parameters as list of tuples, formatting as json if value is collection_types @@ -304,37 +322,7 @@ class ApiClient(object): :param read_files: Whether to read file data or leave files as is. :return: The serialized form of data. """ - if isinstance(obj, (ModelNormal, ModelComposed)): - return { - key: cls.sanitize_for_serialization(val, read_files=read_files) - for key, val in model_to_dict( - obj, - serialize=True).items() - } - elif isinstance(obj, io.IOBase): - if read_files: - return cls.get_file_data_and_close_file(obj) - else: - return obj - elif isinstance(obj, (str, int, float, none_type, bool)): - return obj - elif isinstance(obj, (datetime, date)): - return obj.isoformat() - elif isinstance(obj, ModelSimple): - return cls.sanitize_for_serialization(obj.value, - read_files=read_files) - elif isinstance(obj, (list, tuple)): - return [cls.sanitize_for_serialization(item, read_files=read_files) - for item in obj - ] - if isinstance(obj, dict): - return { - key: cls.sanitize_for_serialization(val, read_files=read_files) - for key, val in obj.items() - } - raise ApiValueError( - 'Unable to prepare type {} for serialization'.format( - obj.__class__.__name__)) + return to_json(obj, read_files=read_files) def deserialize(self, response: HTTPResponse, response_schema: typing.Tuple, *, _check_type: bool): """Deserializes response into an object. @@ -445,7 +433,8 @@ class ApiClient(object): :type collection_formats: dict, optional :param _parse_response: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response - data. Default is True. + data. Response headers will not be + processed (cookies as well). Default is True. :type _parse_response: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -588,18 +577,12 @@ class ApiClient(object): new_params.append((k, v)) return new_params - @staticmethod - def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: - file_data = file_instance.read() - file_instance.close() - return file_data - def _serialize_file(self, file_instance: io.IOBase) -> typing.Tuple[str, typing.Union[str, bytes], str]: if file_instance.closed is True: raise ApiValueError("Cannot read a closed file.") filename = os.path.basename(file_instance.name) - filedata = self.get_file_data_and_close_file(file_instance) + filedata = get_file_data_and_close_file(file_instance) mimetype = mimetypes.guess_type(filename)[0] or 'application/octet-stream' @@ -828,6 +811,10 @@ class Endpoint(object): self.headers_map = headers_map self.api_client = api_client + @property + def path(self) -> str: + return self.settings['endpoint_path'] + def __validate_inputs(self, kwargs): for param in self.params_map['enum']: if param in kwargs: @@ -898,12 +885,23 @@ class Endpoint(object): return params - def call_with_http_info(self, **kwargs) -> typing.Tuple[typing.Optional[typing.Any], HTTPResponse]: + def call_with_http_info(self, + _parse_response: bool = True, + _request_timeout: typing.Union[int, float, tuple] = None, + _validate_inputs: bool = True, + _validate_outputs: bool = True, + _check_status: bool = True, + _spec_property_naming: bool = False, + _content_type: typing.Optional[str] = None, + _host_index: typing.Optional[int] = None, + _request_auths: typing.Optional[typing.List] = None, + _async_call: bool = False, + **kwargs) -> typing.Tuple[typing.Optional[typing.Any], HTTPResponse]: """ Keyword Args: endpoint args - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. + _parse_response (bool): if False, the response data will not be parsed, + None is returned for data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also @@ -915,6 +913,9 @@ class Endpoint(object): _validate_outputs (bool): specifies if type checking should be done one the data received from the server. Default is True. + _check_status (bool): whether to check response status + for being positive or not. + Default is True _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data @@ -937,6 +938,17 @@ class Endpoint(object): thread. """ + kwargs['_parse_response'] = _parse_response + kwargs['_request_timeout'] = _request_timeout + kwargs['_validate_inputs'] = _validate_inputs + kwargs['_validate_outputs'] = _validate_outputs + kwargs['_check_status'] = _check_status + kwargs['_spec_property_naming'] = _spec_property_naming + kwargs['_content_type'] = _content_type + kwargs['_host_index'] = _host_index + kwargs['_request_auths'] = _request_auths + kwargs['_async_call'] = _async_call + try: index = self.api_client.configuration.server_operation_index.get( self.settings['operation_id'], self.api_client.configuration.server_index diff --git a/cvat-sdk/gen/templates/openapi-generator/configuration.mustache b/cvat-sdk/gen/templates/openapi-generator/configuration.mustache new file mode 100644 index 00000000..878e0920 --- /dev/null +++ b/cvat-sdk/gen/templates/openapi-generator/configuration.mustache @@ -0,0 +1,641 @@ +{{>partial_header}} + +import copy +import logging +{{^asyncio}} +import multiprocessing +{{/asyncio}} +import sys +import urllib3 + +from http import client as http_client +from {{packageName}}.exceptions import ApiValueError + + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +class Configuration(object): + """ + NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param host: Base url + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication + :param password: Password for HTTP basic authentication + :param discard_unknown_keys: Boolean value indicating whether to discard + unknown properties. A server may send a response that includes additional + properties that are not known by the client in the following scenarios: + 1. The OpenAPI document is incomplete, i.e. it does not match the server + implementation. + 2. The client was generated using an older version of the OpenAPI document + and the server has been upgraded since then. + If a schema in the OpenAPI document defines the additionalProperties attribute, + then all undeclared properties received by the server are injected into the + additional properties map. In that case, there are undeclared properties, and + nothing to discard. + :param disabled_client_side_validations (string): Comma-separated list of + JSON schema validation keywords to disable JSON schema structural validation + rules. The following keywords may be specified: multipleOf, maximum, + exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, + maxItems, minItems. + By default, the validation is performed for data generated locally by the client + and data received from the server, independent of any validation performed by + the server side. If the input data does not satisfy the JSON schema validation + rules specified in the OpenAPI document, an exception is raised. + If disabled_client_side_validations is set, structural validation is + disabled. This can be useful to troubleshoot data validation problem, such as + when the OpenAPI document validation rules do not match the actual API data + received by the server. +{{#hasHttpSignatureMethods}} + :param signing_info: Configuration parameters for the HTTP signature security scheme. + Must be an instance of {{{packageName}}}.signing.HttpSigningConfiguration +{{/hasHttpSignatureMethods}} + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format + +{{#hasAuthMethods}} + :Example: +{{#hasApiKeyMethods}} + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + + conf = {{{packageName}}}.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} + ) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 +{{/hasApiKeyMethods}} +{{#hasHttpBasicMethods}} + + HTTP Basic Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: basic + + Configure API client with HTTP basic authentication: + + conf = {{{packageName}}}.Configuration( + username='the-user', + password='the-password', + ) + +{{/hasHttpBasicMethods}} +{{#hasHttpSignatureMethods}} + + HTTP Signature Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: signature + + Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, + sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time + of the signature to 5 minutes after the signature has been created. + Note you can use the constants defined in the {{{packageName}}}.signing module, and you can + also specify arbitrary HTTP headers to be included in the HTTP signature, except for the + 'Authorization' header, which is used to carry the signature. + + One may be tempted to sign all headers by default, but in practice it rarely works. + This is because explicit proxies, transparent proxies, TLS termination endpoints or + load balancers may add/modify/remove headers. Include the HTTP headers that you know + are not going to be modified in transit. + + conf = {{{packageName}}}.Configuration( + signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = {{{packageName}}}.signing.SCHEME_HS2019, + signing_algorithm = {{{packageName}}}.signing.ALGORITHM_RSASSA_PSS, + signed_headers = [{{{packageName}}}.signing.HEADER_REQUEST_TARGET, + {{{packageName}}}.signing.HEADER_CREATED, + {{{packageName}}}.signing.HEADER_EXPIRES, + {{{packageName}}}.signing.HEADER_HOST, + {{{packageName}}}.signing.HEADER_DATE, + {{{packageName}}}.signing.HEADER_DIGEST, + 'Content-Type', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) +) +{{/hasHttpSignatureMethods}} +{{/hasAuthMethods}} + """ + + _default = None + + def __init__(self, host=None, + api_key=None, api_key_prefix=None, + access_token=None, + username=None, password=None, + discard_unknown_keys=False, + disabled_client_side_validations="", +{{#hasHttpSignatureMethods}} + signing_info=None, +{{/hasHttpSignatureMethods}} + server_index=None, server_variables=None, + server_operation_index=None, server_operation_variables=None, + ssl_ca_cert=None, + ): + """Constructor + """ + self._base_path = self._fix_host_url("{{{basePath}}}" if host is None else host) + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.access_token = access_token + self.api_key = {} + """dict to store API key(s) + """ + if api_key: + self.api_key = api_key + + self.api_key_prefix = {} + """dict to store API prefix (e.g. Bearer) + """ + if api_key_prefix: + self.api_key_prefix = api_key_prefix + + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.discard_unknown_keys = discard_unknown_keys + self.disabled_client_side_validations = disabled_client_side_validations +{{#hasHttpSignatureMethods}} + if signing_info is not None: + signing_info.host = host + self.signing_info = signing_info + """The HTTP signing configuration + """ +{{/hasHttpSignatureMethods}} + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("{{packageName}}") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + + {{#asyncio}} + self.connection_pool_maxsize = 100 + """This value is passed to the aiohttp to limit simultaneous connections. + Default values is 100, None means no-limit. + """ + {{/asyncio}} + {{^asyncio}} + 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. + """ + {{/asyncio}} + + self.proxy = None + """Proxy URL + """ + self.no_proxy = None + """bypass proxy for host in the no_proxy list. + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + # Options to pass down to the underlying urllib3 socket + self.socket_options = None + + def __deepcopy__(self, memo): + 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'): + 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, value): + object.__setattr__(self, name, value) + if name == 'disabled_client_side_validations': + s = set(filter(None, value.split(','))) + for v in s: + if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: + raise ApiValueError( + "Invalid keyword: '{0}''".format(v)) + self._disabled_client_side_validations = s +{{#hasHttpSignatureMethods}} + if name == "signing_info" and value is not None: + # Ensure the host parameter from signing info is the same as + # Configuration.host. + value.host = self.host +{{/hasHttpSignatureMethods}} + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = copy.deepcopy(default) + + @classmethod + def get_default_copy(cls): + """Return new instance of configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration passed by the set_default method. + + :return: The configuration object. + """ + if cls._default is not None: + return copy.deepcopy(cls._default) + return Configuration() + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on http_client debug + http_client.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 http_client debug + http_client.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier, alias=None): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} +{{#authMethods}} +{{#isApiKey}} + if '{{name}}' in self.api_key{{#vendorExtensions.x-auth-id-alias}} or '{{.}}' in self.api_key{{/vendorExtensions.x-auth-id-alias}}: + auth['{{name}}'] = { + 'type': 'api_key', + 'in': {{#isKeyInCookie}}'cookie'{{/isKeyInCookie}}{{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{#isKeyInQuery}}'query'{{/isKeyInQuery}}, + 'key': '{{keyParamName}}', + 'value': self.get_api_key_with_prefix( + '{{name}}',{{#vendorExtensions.x-auth-id-alias}} + alias='{{.}}',{{/vendorExtensions.x-auth-id-alias}} + ), + } +{{/isApiKey}} +{{#isBasic}} + {{#isBasicBasic}} + if self.username is not None and self.password is not None: + auth['{{name}}'] = { + 'type': 'basic', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_basic_auth_token() + } + {{/isBasicBasic}} + {{#isBasicBearer}} + if self.access_token is not None: + auth['{{name}}'] = { + 'type': 'bearer', + 'in': 'header', + {{#bearerFormat}} + 'format': '{{{.}}}', + {{/bearerFormat}} + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + {{/isBasicBearer}} + {{#isHttpSignature}} + if self.signing_info is not None: + auth['{{name}}'] = { + 'type': 'http-signature', + 'in': 'header', + 'key': 'Authorization', + 'value': None # Signature headers are calculated for every HTTP request + } + {{/isHttpSignature}} +{{/isBasic}} +{{#isOAuth}} + if self.access_token is not None: + auth['{{name}}'] = { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } +{{/isOAuth}} +{{/authMethods}} + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: {{version}}\n"\ + "SDK Package Version: {{packageVersion}}".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + {{#servers}} + { + 'url': "{{{url}}}", + 'description': "{{{description}}}{{^description}}No description provided{{/description}}", + {{#variables}} + {{#-first}} + 'variables': { + {{/-first}} + '{{{name}}}': { + 'description': "{{{description}}}{{^description}}No description provided{{/description}}", + 'default_value': "{{{defaultValue}}}", + {{#enumValues}} + {{#-first}} + 'enum_values': [ + {{/-first}} + "{{{.}}}"{{^-last}},{{/-last}} + {{#-last}} + ] + {{/-last}} + {{/enumValues}} + }{{^-last}},{{/-last}} + {{#-last}} + } + {{/-last}} + {{/variables}} + }{{^-last}},{{/-last}} + {{/servers}} + ] + + def get_host_from_settings(self, index, variables=None, servers=None): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self): + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None + + @staticmethod + def _fix_host_url(url): + url = url.rstrip("/") + + if not (url.startswith("http://") or url.startswith("https://")): + url = "http://" + url + + return url diff --git a/cvat-sdk/gen/templates/openapi-generator/model.mustache b/cvat-sdk/gen/templates/openapi-generator/model.mustache index 74d1f894..75f75645 100644 --- a/cvat-sdk/gen/templates/openapi-generator/model.mustache +++ b/cvat-sdk/gen/templates/openapi-generator/model.mustache @@ -27,8 +27,8 @@ from {{packageName}}.exceptions import ApiAttributeError from typing import TYPE_CHECKING if TYPE_CHECKING: # Enable introspection. Can't work normally due to cyclic imports - from cvat_sdk.apis import * - from cvat_sdk.models import * + from {{packageName}}.apis import * + from {{packageName}}.models import * {{#models}} {{#model}} diff --git a/cvat-sdk/gen/templates/openapi-generator/model_templates/classvars.mustache b/cvat-sdk/gen/templates/openapi-generator/model_templates/classvars.mustache index eb59ce7c..01acbc45 100644 --- a/cvat-sdk/gen/templates/openapi-generator/model_templates/classvars.mustache +++ b/cvat-sdk/gen/templates/openapi-generator/model_templates/classvars.mustache @@ -136,16 +136,3 @@ if not val: return None return {'{{{discriminatorName}}}': val}{{/discriminator}} - -{{#vars}} - {{#-first}} - # member type declarations - {{/-first}} - {{name}}: {{> model_templates/type_annotation_cleaned }} # noqa: E501 - """{{^required}} - [optional{{#defaultValue}}, default: {{{.}}}{{/defaultValue}}]{{/required}}{{#isContainer}} - {{{dataType}}}{{/isContainer}}{{#description}} - {{{.}}}.{{/description}} - """ - -{{/vars}} \ No newline at end of file diff --git a/cvat-sdk/gen/templates/openapi-generator/model_templates/method_from_openapi_data_shared.mustache b/cvat-sdk/gen/templates/openapi-generator/model_templates/method_from_openapi_data_shared.mustache index ba4dc350..4c149f22 100644 --- a/cvat-sdk/gen/templates/openapi-generator/model_templates/method_from_openapi_data_shared.mustache +++ b/cvat-sdk/gen/templates/openapi-generator/model_templates/method_from_openapi_data_shared.mustache @@ -18,13 +18,15 @@ {{#requiredVars}} {{#defaultValue}} {{name}} ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 + {{/defaultValue}} {{/requiredVars}} -{{> model_templates/docstring_init_required_kwargs }} {{#optionalVars}} {{name}} ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} # noqa: E501 + {{/optionalVars}} - """ +{{> model_templates/docstring_init_required_kwargs }} +""" from {{packageName}}.configuration import Configuration {{#requiredVars}} diff --git a/cvat-sdk/gen/templates/openapi-generator/model_templates/method_init_shared.mustache b/cvat-sdk/gen/templates/openapi-generator/model_templates/method_init_shared.mustache index f9af3e0d..998b4841 100644 --- a/cvat-sdk/gen/templates/openapi-generator/model_templates/method_init_shared.mustache +++ b/cvat-sdk/gen/templates/openapi-generator/model_templates/method_init_shared.mustache @@ -20,14 +20,16 @@ {{^isReadOnly}} {{#defaultValue}} {{name}} ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501 + {{/defaultValue}} {{/isReadOnly}} {{/requiredVars}} -{{> model_templates/docstring_init_required_kwargs }} {{#optionalVars}} {{name}} ({{{dataType}}}):{{#description}} {{{.}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} # noqa: E501 + {{/optionalVars}} - """ +{{> model_templates/docstring_init_required_kwargs }} +""" from {{packageName}}.configuration import Configuration {{#requiredVars}} diff --git a/cvat-sdk/gen/templates/openapi-generator/model_templates/model_normal.mustache b/cvat-sdk/gen/templates/openapi-generator/model_templates/model_normal.mustache index e42c7221..06eae9fa 100644 --- a/cvat-sdk/gen/templates/openapi-generator/model_templates/model_normal.mustache +++ b/cvat-sdk/gen/templates/openapi-generator/model_templates/model_normal.mustache @@ -1,5 +1,28 @@ -class {{classname}}(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. + +class I{{classname}}: + """ + NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + +{{#vars}} + {{#-first}} + # member type declarations + {{/-first}} + {{name}}: {{> model_templates/type_annotation_cleaned }} # noqa: E501 + """{{^required}} + [optional{{#defaultValue}}, default: {{{.}}}{{/defaultValue}}]{{/required}}{{#isContainer}} + {{{dataType}}}{{/isContainer}}{{#description}} + {{{.}}}.{{/description}} + """ + +{{/vars}} + +class {{classname}}(ModelNormal, I{{classname}}): + """ + NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. diff --git a/cvat-sdk/gen/templates/openapi-generator/model_templates/model_simple.mustache b/cvat-sdk/gen/templates/openapi-generator/model_templates/model_simple.mustache new file mode 100644 index 00000000..de03cd5b --- /dev/null +++ b/cvat-sdk/gen/templates/openapi-generator/model_templates/model_simple.mustache @@ -0,0 +1,38 @@ + +class I{{classname}}: + """ + NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + value: {{> model_templates/type_annotation_cleaned}} + """{{^required}} + [optional{{#defaultValue}}, default: {{{.}}}{{/defaultValue}}]{{/required}} + + {{#allowableValues}}One of: {{#enumVars}}{{#-first}}{{{value}}}{{/-first}}{{^-first}}, {{{value}}}{{/-first}}{{/enumVars}}{{/allowableValues}} # noqa: E501 + """ + +class {{classname}}(ModelSimple, I{{classname}}): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: +{{> model_templates/docstring_allowed }} +{{> model_templates/docstring_openapi_validations }} + """ + +{{> model_templates/classvars }} + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + +{{> model_templates/method_init_simple}} + +{{> model_templates/method_from_openapi_data_simple}} \ No newline at end of file diff --git a/cvat-sdk/cvat_sdk/model_utils.py b/cvat-sdk/gen/templates/openapi-generator/model_utils.mustache similarity index 69% rename from cvat-sdk/cvat_sdk/model_utils.py rename to cvat-sdk/gen/templates/openapi-generator/model_utils.mustache index 5e516c27..3b3cbd1c 100644 --- a/cvat-sdk/cvat_sdk/model_utils.py +++ b/cvat-sdk/gen/templates/openapi-generator/model_utils.mustache @@ -1,16 +1,7 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - +{{>partial_header}} +from datetime import date, datetime # noqa: F401 +from copy import deepcopy import inspect import io import os @@ -18,12 +9,15 @@ import pprint import re import tempfile import uuid -from copy import deepcopy -from datetime import date, datetime # noqa: F401 from dateutil.parser import parse -from cvat_sdk.exceptions import ApiAttributeError, ApiKeyError, ApiTypeError, ApiValueError +from {{packageName}}.exceptions import ( + ApiKeyError, + ApiAttributeError, + ApiTypeError, + ApiValueError, +) none_type = type(None) file_type = io.IOBase @@ -31,7 +25,6 @@ file_type = io.IOBase def convert_js_args_to_python_args(fn): from functools import wraps - @wraps(fn) def wrapped_init(_self, *args, **kwargs): """ @@ -39,13 +32,12 @@ def convert_js_args_to_python_args(fn): parameter of a class method. During generation, `self` attributes are mapped to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. """ - spec_property_naming = kwargs.get("_spec_property_naming", False) + spec_property_naming = kwargs.get('_spec_property_naming', False) if spec_property_naming: kwargs = change_keys_js_to_python( - kwargs, _self if isinstance(_self, type) else _self.__class__ - ) + kwargs, _self if isinstance( + _self, type) else _self.__class__) return fn(_self, *args, **kwargs) - return wrapped_init @@ -53,7 +45,7 @@ class cached_property(object): # this caches the result of the function call for fn with no inputs # use this as a decorator on function methods that you want converted # into cached properties - result_key = "_results" + result_key = '_results' def __init__(self, fn): self._fn = fn @@ -83,12 +75,15 @@ def allows_single_value_input(cls): - null TODO: lru_cache this """ - if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: + if ( + issubclass(cls, ModelSimple) or + cls in PRIMITIVE_TYPES + ): return True elif issubclass(cls, ModelComposed): - if not cls._composed_schemas["oneOf"]: + if not cls._composed_schemas['oneOf']: return False - return any(allows_single_value_input(c) for c in cls._composed_schemas["oneOf"]) + return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) return False @@ -106,11 +101,11 @@ def composed_model_input_classes(cls): else: return get_discriminated_classes(cls) elif issubclass(cls, ModelComposed): - if not cls._composed_schemas["oneOf"]: + if not cls._composed_schemas['oneOf']: return [] if cls.discriminator is None: input_classes = [] - for c in cls._composed_schemas["oneOf"]: + for c in cls._composed_schemas['oneOf']: input_classes.extend(composed_model_input_classes(c)) return input_classes else: @@ -121,80 +116,9 @@ def composed_model_input_classes(cls): class OpenApiModel(object): """The base class for all OpenAPIModels""" - def set_attribute(self, name, value): - # this is only used to set properties on self - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format(type(self).__name__, name), path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, var_value=name, valid_classes=(str,), key_type=True - ) - raise ApiTypeError( - error_msg, path_to_item=path_to_item, valid_classes=(str,), key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, - required_types_mixed, - path_to_item, - self._spec_property_naming, - self._check_type, - configuration=self._configuration, - ) - if (name,) in self.allowed_values: - check_allowed_values(self.allowed_values, (name,), value) - if (name,) in self.validations: - check_validations(self.validations, (name,), value, self._configuration) - self.__dict__["_data_store"][name] = value - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - def __setattr__(self, attr, value): - """set the value of an attribute using dot notation: `instance.attr = val`""" - self[attr] = value - - def __getattr__(self, attr): - """get the value of an attribute using dot notation: `instance.attr`""" - return self.__getitem__(attr) - - def __copy__(self): - cls = self.__class__ - if self.get("_spec_property_naming", False): - return cls._new_from_openapi_data(**self.__dict__) - else: - return cls.__new__(cls, **self.__dict__) - - def __deepcopy__(self, memo): - cls = self.__class__ +{{> model_templates/method_set_attribute }} - if self.get("_spec_property_naming", False): - new_inst = cls._new_from_openapi_data() - else: - new_inst = cls.__new__(cls) - - for k, v in self.__dict__.items(): - setattr(new_inst, k, deepcopy(v, memo)) - return new_inst +{{> model_templates/methods_shared }} def __new__(cls, *args, **kwargs): # this function uses the discriminator to @@ -212,8 +136,11 @@ class OpenApiModel(object): oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) return oneof_instance - visited_composed_classes = kwargs.get("_visited_composed_classes", ()) - if cls.discriminator is None or cls in visited_composed_classes: + visited_composed_classes = kwargs.get('_visited_composed_classes', ()) + if ( + cls.discriminator is None or + cls in visited_composed_classes + ): # Use case 1: this openapi schema (cls) does not have a discriminator # Use case 2: we have already visited this class before and are sure that we # want to instantiate it this time. We have visited this class deserializing @@ -243,26 +170,28 @@ class OpenApiModel(object): discr_value = kwargs[discr_propertyname_py] else: # The input data does not contain the discriminator property. - path_to_item = kwargs.get("_path_to_item", ()) + path_to_item = kwargs.get('_path_to_item', ()) raise ApiValueError( "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" - % (discr_propertyname_js, path_to_item) + "The discriminator property '%s' is missing at path: %s" % + (discr_propertyname_js, path_to_item) ) # Implementation note: the last argument to get_discriminator_class # is a list of visited classes. get_discriminator_class may recursively # call itself and update the list of visited classes, and the initial # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class(cls, discr_propertyname_py, discr_value, []) + new_cls = get_discriminator_class( + cls, discr_propertyname_py, discr_value, []) if new_cls is None: - path_to_item = kwargs.get("_path_to_item", ()) - disc_prop_value = kwargs.get(discr_propertyname_js, kwargs.get(discr_propertyname_py)) + path_to_item = kwargs.get('_path_to_item', ()) + disc_prop_value = kwargs.get( + discr_propertyname_js, kwargs.get(discr_propertyname_py)) raise ApiValueError( "Cannot deserialize input data due to invalid discriminator " "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" - % (discr_propertyname_js, disc_prop_value, path_to_item) + "property '%s'='%s' at path: %s" % + (discr_propertyname_js, disc_prop_value, path_to_item) ) if new_cls in visited_composed_classes: @@ -287,13 +216,13 @@ class OpenApiModel(object): # Build a list containing all oneOf and anyOf descendants. oneof_anyof_classes = None if cls._composed_schemas is not None: - oneof_anyof_classes = cls._composed_schemas.get( - "oneOf", () - ) + cls._composed_schemas.get("anyOf", ()) + oneof_anyof_classes = ( + cls._composed_schemas.get('oneOf', ()) + + cls._composed_schemas.get('anyOf', ())) oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs["_visited_composed_classes"] = visited_composed_classes + (cls,) + kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - if cls._composed_schemas.get("allOf") and oneof_anyof_child: + if cls._composed_schemas.get('allOf') and oneof_anyof_child: # Validate that we can make self because when we make the # new_cls it will not include the allOf validations in self self_inst = super(OpenApiModel, cls).__new__(cls) @@ -326,8 +255,11 @@ class OpenApiModel(object): oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) return oneof_instance - visited_composed_classes = kwargs.get("_visited_composed_classes", ()) - if cls.discriminator is None or cls in visited_composed_classes: + visited_composed_classes = kwargs.get('_visited_composed_classes', ()) + if ( + cls.discriminator is None or + cls in visited_composed_classes + ): # Use case 1: this openapi schema (cls) does not have a discriminator # Use case 2: we have already visited this class before and are sure that we # want to instantiate it this time. We have visited this class deserializing @@ -357,26 +289,28 @@ class OpenApiModel(object): discr_value = kwargs[discr_propertyname_py] else: # The input data does not contain the discriminator property. - path_to_item = kwargs.get("_path_to_item", ()) + path_to_item = kwargs.get('_path_to_item', ()) raise ApiValueError( "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" - % (discr_propertyname_js, path_to_item) + "The discriminator property '%s' is missing at path: %s" % + (discr_propertyname_js, path_to_item) ) # Implementation note: the last argument to get_discriminator_class # is a list of visited classes. get_discriminator_class may recursively # call itself and update the list of visited classes, and the initial # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class(cls, discr_propertyname_py, discr_value, []) + new_cls = get_discriminator_class( + cls, discr_propertyname_py, discr_value, []) if new_cls is None: - path_to_item = kwargs.get("_path_to_item", ()) - disc_prop_value = kwargs.get(discr_propertyname_js, kwargs.get(discr_propertyname_py)) + path_to_item = kwargs.get('_path_to_item', ()) + disc_prop_value = kwargs.get( + discr_propertyname_js, kwargs.get(discr_propertyname_py)) raise ApiValueError( "Cannot deserialize input data due to invalid discriminator " "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" - % (discr_propertyname_js, disc_prop_value, path_to_item) + "property '%s'='%s' at path: %s" % + (discr_propertyname_js, disc_prop_value, path_to_item) ) if new_cls in visited_composed_classes: @@ -401,13 +335,13 @@ class OpenApiModel(object): # Build a list containing all oneOf and anyOf descendants. oneof_anyof_classes = None if cls._composed_schemas is not None: - oneof_anyof_classes = cls._composed_schemas.get( - "oneOf", () - ) + cls._composed_schemas.get("anyOf", ()) + oneof_anyof_classes = ( + cls._composed_schemas.get('oneOf', ()) + + cls._composed_schemas.get('anyOf', ())) oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs["_visited_composed_classes"] = visited_composed_classes + (cls,) + kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - if cls._composed_schemas.get("allOf") and oneof_anyof_child: + if cls._composed_schemas.get('allOf') and oneof_anyof_child: # Validate that we can make self because when we make the # new_cls it will not include the allOf validations in self self_inst = cls._from_openapi_data(*args, **kwargs) @@ -420,116 +354,18 @@ class ModelSimple(OpenApiModel): """the parent class of models whose type != object in their swagger/openapi""" - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__["_data_store"].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format(type(self).__name__, name), - [e for e in [self._path_to_item, name] if e], - ) - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__["_data_store"] - - def to_str(self): - """Returns the string representation of the model""" - return str(self.value) +{{> model_templates/methods_setattr_getattr_normal }} - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - this_val = self._data_store["value"] - that_val = other._data_store["value"] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - return vals_equal +{{> model_templates/methods_tostr_eq_simple }} class ModelNormal(OpenApiModel): """the parent class of models whose type == object in their swagger/openapi""" - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__["_data_store"].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format(type(self).__name__, name), - [e for e in [self._path_to_item, name] if e], - ) - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__["_data_store"] - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) +{{> model_templates/methods_setattr_getattr_normal }} - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True +{{> model_templates/methods_todict_tostr_eq_shared}} class ModelComposed(OpenApiModel): @@ -558,140 +394,16 @@ class ModelComposed(OpenApiModel): which contain the value that the key is referring to. """ - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - """ - Use cases: - 1. additional_properties_type is None (additionalProperties == False in spec) - Check for property presence in self.openapi_types - if not present then throw an error - if present set in self, set attribute - always set on composed schemas - 2. additional_properties_type exists - set attribute on self - always set on composed schemas - """ - if self.additional_properties_type is None: - """ - For an attribute to exist on a composed schema it must: - - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND - - fulfill schema_requirements in each oneOf/anyOf/allOf schemas - - schema_requirements: - For an attribute to exist on a schema it must: - - be present in properties at the schema OR - - have additionalProperties unset (defaults additionalProperties = any type) OR - - have additionalProperties set - """ - if name not in self.openapi_types: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format(type(self).__name__, name), - [e for e in [self._path_to_item, name] if e], - ) - # attribute must be set on self and composed instances - self.set_attribute(name, value) - for model_instance in self._composed_instances: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__["_var_name_to_model_instances"][name] = self._composed_instances + [self] - return None - - __unset_attribute_value__ = object() - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get(name) - values = [] - # A composed model stores self and child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. - # Any property must exist in self and all model instances - # The value stored in all model instances must be the same - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - v = model_instance._data_store[name] - if v not in values: - values.append(v) - len_values = len(values) - if len_values == 0: - return default - elif len_values == 1: - return values[0] - elif len_values > 1: - raise ApiValueError( - "Values stored for property {0} in {1} differ when looking " - "at self and self's composed instances. All values must be " - "the same".format(name, type(self).__name__), - [e for e in [self._path_to_item, name] if e], - ) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - value = self.get(name, self.__unset_attribute_value__) - if value is self.__unset_attribute_value__: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format(type(self).__name__, name), - [e for e in [self._path_to_item, name] if e], - ) - return value - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" +{{> model_templates/methods_setattr_getattr_composed }} - if name in self.required_properties: - return name in self.__dict__ - - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances - ) - - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - return True - - return False - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True +{{> model_templates/methods_todict_tostr_eq_shared}} COERCION_INDEX_BY_TYPE = { ModelComposed: 0, ModelNormal: 1, ModelSimple: 2, - none_type: 3, # The type of 'None'. + none_type: 3, # The type of 'None'. list: 4, dict: 5, float: 6, @@ -700,7 +412,7 @@ COERCION_INDEX_BY_TYPE = { datetime: 9, date: 10, str: 11, - file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. + file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. } # these are used to limit what type conversions we try to do @@ -757,7 +469,7 @@ COERCIBLE_TYPE_PAIRS = { (str, date), # (int, str), # (float, str), - (str, file_type), + (str, file_type) ), } @@ -814,24 +526,41 @@ def check_allowed_values(allowed_values, input_variable_path, input_values): are checking to see if they are in allowed_values """ these_allowed_values = list(allowed_values[input_variable_path].values()) - if isinstance(input_values, list) and not set(input_values).issubset(set(these_allowed_values)): - invalid_values = (", ".join(map(str, set(input_values) - set(these_allowed_values))),) + if (isinstance(input_values, list) + and not set(input_values).issubset( + set(these_allowed_values))): + invalid_values = ", ".join( + map(str, set(input_values) - set(these_allowed_values))), raise ApiValueError( - "Invalid values for `%s` [%s], must be a subset of [%s]" - % (input_variable_path[0], invalid_values, ", ".join(map(str, these_allowed_values))) + "Invalid values for `%s` [%s], must be a subset of [%s]" % + ( + input_variable_path[0], + invalid_values, + ", ".join(map(str, these_allowed_values)) + ) ) - elif isinstance(input_values, dict) and not set(input_values.keys()).issubset( - set(these_allowed_values) - ): - invalid_values = ", ".join(map(str, set(input_values.keys()) - set(these_allowed_values))) + elif (isinstance(input_values, dict) + and not set( + input_values.keys()).issubset(set(these_allowed_values))): + invalid_values = ", ".join( + map(str, set(input_values.keys()) - set(these_allowed_values))) raise ApiValueError( - "Invalid keys in `%s` [%s], must be a subset of [%s]" - % (input_variable_path[0], invalid_values, ", ".join(map(str, these_allowed_values))) + "Invalid keys in `%s` [%s], must be a subset of [%s]" % + ( + input_variable_path[0], + invalid_values, + ", ".join(map(str, these_allowed_values)) + ) ) - elif not isinstance(input_values, (list, dict)) and input_values not in these_allowed_values: + elif (not isinstance(input_values, (list, dict)) + and input_values not in these_allowed_values): raise ApiValueError( - "Invalid value for `%s` (%s), must be one of %s" - % (input_variable_path[0], input_values, these_allowed_values) + "Invalid value for `%s` (%s), must be one of %s" % + ( + input_variable_path[0], + input_values, + these_allowed_values + ) ) @@ -845,14 +574,14 @@ def is_json_validation_enabled(schema_keyword, configuration=None): configuration (Configuration): the configuration class. """ - return ( - configuration is None - or not hasattr(configuration, "_disabled_client_side_validations") - or schema_keyword not in configuration._disabled_client_side_validations - ) + return (configuration is None or + not hasattr(configuration, '_disabled_client_side_validations') or + schema_keyword not in configuration._disabled_client_side_validations) -def check_validations(validations, input_variable_path, input_values, configuration=None): +def check_validations( + validations, input_variable_path, input_values, + configuration=None): """Raises an exception if the input_values are invalid Args: @@ -867,60 +596,66 @@ def check_validations(validations, input_variable_path, input_values, configurat return current_validations = validations[input_variable_path] - if ( - is_json_validation_enabled("multipleOf", configuration) - and "multiple_of" in current_validations - and isinstance(input_values, (int, float)) - and not (float(input_values) / current_validations["multiple_of"]).is_integer() - ): + if (is_json_validation_enabled('multipleOf', configuration) and + 'multiple_of' in current_validations and + isinstance(input_values, (int, float)) and + not (float(input_values) / current_validations['multiple_of']).is_integer()): # Note 'multipleOf' will be as good as the floating point arithmetic. raise ApiValueError( "Invalid value for `%s`, value must be a multiple of " - "`%s`" % (input_variable_path[0], current_validations["multiple_of"]) + "`%s`" % ( + input_variable_path[0], + current_validations['multiple_of'] + ) ) - if ( - is_json_validation_enabled("maxLength", configuration) - and "max_length" in current_validations - and len(input_values) > current_validations["max_length"] - ): + if (is_json_validation_enabled('maxLength', configuration) and + 'max_length' in current_validations and + len(input_values) > current_validations['max_length']): raise ApiValueError( "Invalid value for `%s`, length must be less than or equal to " - "`%s`" % (input_variable_path[0], current_validations["max_length"]) + "`%s`" % ( + input_variable_path[0], + current_validations['max_length'] + ) ) - if ( - is_json_validation_enabled("minLength", configuration) - and "min_length" in current_validations - and len(input_values) < current_validations["min_length"] - ): + if (is_json_validation_enabled('minLength', configuration) and + 'min_length' in current_validations and + len(input_values) < current_validations['min_length']): raise ApiValueError( "Invalid value for `%s`, length must be greater than or equal to " - "`%s`" % (input_variable_path[0], current_validations["min_length"]) + "`%s`" % ( + input_variable_path[0], + current_validations['min_length'] + ) ) - if ( - is_json_validation_enabled("maxItems", configuration) - and "max_items" in current_validations - and len(input_values) > current_validations["max_items"] - ): + if (is_json_validation_enabled('maxItems', configuration) and + 'max_items' in current_validations and + len(input_values) > current_validations['max_items']): raise ApiValueError( "Invalid value for `%s`, number of items must be less than or " - "equal to `%s`" % (input_variable_path[0], current_validations["max_items"]) + "equal to `%s`" % ( + input_variable_path[0], + current_validations['max_items'] + ) ) - if ( - is_json_validation_enabled("minItems", configuration) - and "min_items" in current_validations - and len(input_values) < current_validations["min_items"] - ): + if (is_json_validation_enabled('minItems', configuration) and + 'min_items' in current_validations and + len(input_values) < current_validations['min_items']): raise ValueError( "Invalid value for `%s`, number of items must be greater than or " - "equal to `%s`" % (input_variable_path[0], current_validations["min_items"]) + "equal to `%s`" % ( + input_variable_path[0], + current_validations['min_items'] + ) ) - items = ("exclusive_maximum", "inclusive_maximum", "exclusive_minimum", "inclusive_minimum") - if any(item in current_validations for item in items): + items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', + 'inclusive_minimum') + if (any(item in current_validations for item in items)): if isinstance(input_values, list): max_val = max(input_values) min_val = min(input_values) @@ -931,54 +666,56 @@ def check_validations(validations, input_variable_path, input_values, configurat max_val = input_values min_val = input_values - if ( - is_json_validation_enabled("exclusiveMaximum", configuration) - and "exclusive_maximum" in current_validations - and max_val >= current_validations["exclusive_maximum"] - ): + if (is_json_validation_enabled('exclusiveMaximum', configuration) and + 'exclusive_maximum' in current_validations and + max_val >= current_validations['exclusive_maximum']): raise ApiValueError( - "Invalid value for `%s`, must be a value less than `%s`" - % (input_variable_path[0], current_validations["exclusive_maximum"]) + "Invalid value for `%s`, must be a value less than `%s`" % ( + input_variable_path[0], + current_validations['exclusive_maximum'] + ) ) - if ( - is_json_validation_enabled("maximum", configuration) - and "inclusive_maximum" in current_validations - and max_val > current_validations["inclusive_maximum"] - ): + if (is_json_validation_enabled('maximum', configuration) and + 'inclusive_maximum' in current_validations and + max_val > current_validations['inclusive_maximum']): raise ApiValueError( "Invalid value for `%s`, must be a value less than or equal to " - "`%s`" % (input_variable_path[0], current_validations["inclusive_maximum"]) + "`%s`" % ( + input_variable_path[0], + current_validations['inclusive_maximum'] + ) ) - if ( - is_json_validation_enabled("exclusiveMinimum", configuration) - and "exclusive_minimum" in current_validations - and min_val <= current_validations["exclusive_minimum"] - ): + if (is_json_validation_enabled('exclusiveMinimum', configuration) and + 'exclusive_minimum' in current_validations and + min_val <= current_validations['exclusive_minimum']): raise ApiValueError( - "Invalid value for `%s`, must be a value greater than `%s`" - % (input_variable_path[0], current_validations["exclusive_maximum"]) + "Invalid value for `%s`, must be a value greater than `%s`" % + ( + input_variable_path[0], + current_validations['exclusive_maximum'] + ) ) - if ( - is_json_validation_enabled("minimum", configuration) - and "inclusive_minimum" in current_validations - and min_val < current_validations["inclusive_minimum"] - ): + if (is_json_validation_enabled('minimum', configuration) and + 'inclusive_minimum' in current_validations and + min_val < current_validations['inclusive_minimum']): raise ApiValueError( "Invalid value for `%s`, must be a value greater than or equal " - "to `%s`" % (input_variable_path[0], current_validations["inclusive_minimum"]) + "to `%s`" % ( + input_variable_path[0], + current_validations['inclusive_minimum'] + ) ) - flags = current_validations.get("regex", {}).get("flags", 0) - if ( - is_json_validation_enabled("pattern", configuration) - and "regex" in current_validations - and not re.search(current_validations["regex"]["pattern"], input_values, flags=flags) - ): + flags = current_validations.get('regex', {}).get('flags', 0) + if (is_json_validation_enabled('pattern', configuration) and + 'regex' in current_validations and + not re.search(current_validations['regex']['pattern'], + input_values, flags=flags)): err_msg = r"Invalid value for `%s`, must match regular expression `%s`" % ( input_variable_path[0], - current_validations["regex"]["pattern"], + current_validations['regex']['pattern'] ) if flags != 0: # Don't print the regex flags if the flags are not @@ -1004,25 +741,28 @@ def order_response_types(required_types): return COERCION_INDEX_BY_TYPE[list] elif isinstance(class_or_instance, dict): return COERCION_INDEX_BY_TYPE[dict] - elif inspect.isclass(class_or_instance) and issubclass(class_or_instance, ModelComposed): + elif (inspect.isclass(class_or_instance) + and issubclass(class_or_instance, ModelComposed)): return COERCION_INDEX_BY_TYPE[ModelComposed] - elif inspect.isclass(class_or_instance) and issubclass(class_or_instance, ModelNormal): + elif (inspect.isclass(class_or_instance) + and issubclass(class_or_instance, ModelNormal)): return COERCION_INDEX_BY_TYPE[ModelNormal] - elif inspect.isclass(class_or_instance) and issubclass(class_or_instance, ModelSimple): + elif (inspect.isclass(class_or_instance) + and issubclass(class_or_instance, ModelSimple)): return COERCION_INDEX_BY_TYPE[ModelSimple] elif class_or_instance in COERCION_INDEX_BY_TYPE: return COERCION_INDEX_BY_TYPE[class_or_instance] raise ApiValueError("Unsupported type: %s" % class_or_instance) sorted_types = sorted( - required_types, key=lambda class_or_instance: index_getter(class_or_instance) + required_types, + key=lambda class_or_instance: index_getter(class_or_instance) ) return sorted_types -def remove_uncoercible( - required_types_classes, current_item, spec_property_naming, must_convert=True -): +def remove_uncoercible(required_types_classes, current_item, spec_property_naming, + must_convert=True): """Only keeps the type conversions that are possible Args: @@ -1078,7 +818,7 @@ def get_discriminated_classes(cls): if is_type_nullable(cls): possible_classes.append(cls) for discr_cls in cls.discriminator[key].values(): - if hasattr(discr_cls, "discriminator") and discr_cls.discriminator is not None: + if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: possible_classes.extend(get_discriminated_classes(discr_cls)) else: possible_classes.append(discr_cls) @@ -1090,7 +830,7 @@ def get_possible_classes(cls, from_server_context): possible_classes = [cls] if from_server_context: return possible_classes - if hasattr(cls, "discriminator") and cls.discriminator is not None: + if hasattr(cls, 'discriminator') and cls.discriminator is not None: possible_classes = [] possible_classes.extend(get_discriminated_classes(cls)) elif issubclass(cls, ModelComposed): @@ -1146,10 +886,11 @@ def change_keys_js_to_python(input_dict, model_class): document). """ - if getattr(model_class, "attribute_map", None) is None: + if getattr(model_class, 'attribute_map', None) is None: return input_dict output_dict = {} - reversed_attr_map = {value: key for key, value in model_class.attribute_map.items()} + reversed_attr_map = {value: key for key, value in + model_class.attribute_map.items()} for javascript_key, value in input_dict.items(): python_key = reversed_attr_map.get(javascript_key) if python_key is None: @@ -1165,10 +906,13 @@ def get_type_error(var_value, path_to_item, valid_classes, key_type=False): var_name=path_to_item[-1], var_value=var_value, valid_classes=valid_classes, - key_type=key_type, + key_type=key_type ) return ApiTypeError( - error_msg, path_to_item=path_to_item, valid_classes=valid_classes, key_type=key_type + error_msg, + path_to_item=path_to_item, + valid_classes=valid_classes, + key_type=key_type ) @@ -1194,11 +938,11 @@ def deserialize_primitive(data, klass, path_to_item): # The string should be in iso8601 datetime format. parsed_datetime = parse(data) date_only = ( - parsed_datetime.hour == 0 - and parsed_datetime.minute == 0 - and parsed_datetime.second == 0 - and parsed_datetime.tzinfo is None - and 8 <= len(data) <= 10 + parsed_datetime.hour == 0 and + parsed_datetime.minute == 0 and + parsed_datetime.second == 0 and + parsed_datetime.tzinfo is None and + 8 <= len(data) <= 10 ) if date_only: raise ValueError("This is a date, not a datetime") @@ -1212,17 +956,21 @@ def deserialize_primitive(data, klass, path_to_item): if isinstance(data, str) and klass == float: if str(converted_value) != data: # '7' -> 7.0 -> '7.0' != '7' - raise ValueError("This is not a float") + raise ValueError('This is not a float') return converted_value except (OverflowError, ValueError) as ex: # parse can raise OverflowError raise ApiValueError( - "{0}Failed to parse {1} as {2}".format(additional_message, repr(data), klass.__name__), - path_to_item=path_to_item, + "{0}Failed to parse {1} as {2}".format( + additional_message, repr(data), klass.__name__ + ), + path_to_item=path_to_item ) from ex -def get_discriminator_class(model_class, discr_name, discr_value, cls_visited): +def get_discriminator_class(model_class, + discr_name, + discr_value, cls_visited): """Returns the child class specified by the discriminator. Args: @@ -1258,25 +1006,22 @@ def get_discriminator_class(model_class, discr_name, discr_value, cls_visited): # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig # if we try to make BasquePig from mammal, we need to travel through # the oneOf descendant discriminators to find BasquePig - descendant_classes = model_class._composed_schemas.get( - "oneOf", () - ) + model_class._composed_schemas.get("anyOf", ()) - ancestor_classes = model_class._composed_schemas.get("allOf", ()) + descendant_classes = model_class._composed_schemas.get('oneOf', ()) + \ + model_class._composed_schemas.get('anyOf', ()) + ancestor_classes = model_class._composed_schemas.get('allOf', ()) possible_classes = descendant_classes + ancestor_classes for cls in possible_classes: # Check if the schema has inherited discriminators. - if hasattr(cls, "discriminator") and cls.discriminator is not None: + if hasattr(cls, 'discriminator') and cls.discriminator is not None: used_model_class = get_discriminator_class( - cls, discr_name, discr_value, cls_visited - ) + cls, discr_name, discr_value, cls_visited) if used_model_class is not None: return used_model_class return used_model_class -def deserialize_model( - model_data, model_class, path_to_item, check_type, configuration, spec_property_naming -): +def deserialize_model(model_data, model_class, path_to_item, check_type, + configuration, spec_property_naming): """Deserializes model_data to model instance. Args: @@ -1300,12 +1045,10 @@ def deserialize_model( ApiKeyError """ - kw_args = dict( - _check_type=check_type, - _path_to_item=path_to_item, - _configuration=configuration, - _spec_property_naming=spec_property_naming, - ) + kw_args = dict(_check_type=check_type, + _path_to_item=path_to_item, + _configuration=configuration, + _spec_property_naming=spec_property_naming) if issubclass(model_class, ModelSimple): return model_class._new_from_openapi_data(model_data, **kw_args) @@ -1341,7 +1084,9 @@ def deserialize_file(response_data, configuration, content_disposition=None): os.remove(path) if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition, flags=re.I) + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition, + flags=re.I) if filename is not None: filename = filename.group(1) else: @@ -1352,23 +1097,16 @@ def deserialize_file(response_data, configuration, content_disposition=None): with open(path, "wb") as f: if isinstance(response_data, str): # change str to bytes so we can write it - response_data = response_data.encode("utf-8") + response_data = response_data.encode('utf-8') f.write(response_data) f = open(path, "rb") return f -def attempt_convert_item( - input_value, - valid_classes, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=False, - check_type=True, -): +def attempt_convert_item(input_value, valid_classes, path_to_item, + configuration, spec_property_naming, key_type=False, + must_convert=False, check_type=True): """ Args: input_value (any): the data to convert @@ -1394,27 +1132,23 @@ def attempt_convert_item( """ valid_classes_ordered = order_response_types(valid_classes) valid_classes_coercible = remove_uncoercible( - valid_classes_ordered, input_value, spec_property_naming - ) + valid_classes_ordered, input_value, spec_property_naming) if not valid_classes_coercible or key_type: # we do not handle keytype errors, json will take care # of this for us if configuration is None or not configuration.discard_unknown_keys: - raise get_type_error(input_value, path_to_item, valid_classes, key_type=key_type) + raise get_type_error(input_value, path_to_item, valid_classes, + key_type=key_type) for valid_class in valid_classes_coercible: try: if issubclass(valid_class, OpenApiModel): - return deserialize_model( - input_value, - valid_class, - path_to_item, - check_type, - configuration, - spec_property_naming, - ) + return deserialize_model(input_value, valid_class, + path_to_item, check_type, + configuration, spec_property_naming) elif valid_class == file_type: return deserialize_file(input_value, configuration) - return deserialize_primitive(input_value, valid_class, path_to_item) + return deserialize_primitive(input_value, valid_class, + path_to_item) except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: if must_convert: raise conversion_exc @@ -1446,10 +1180,10 @@ def is_type_nullable(input_type): return True if issubclass(input_type, ModelComposed): # If oneOf/anyOf, check if the 'null' type is one of the allowed types. - for t in input_type._composed_schemas.get("oneOf", ()): + for t in input_type._composed_schemas.get('oneOf', ()): if is_type_nullable(t): return True - for t in input_type._composed_schemas.get("anyOf", ()): + for t in input_type._composed_schemas.get('anyOf', ()): if is_type_nullable(t): return True return False @@ -1465,22 +1199,13 @@ def is_valid_type(input_class_simple, valid_classes): Returns: bool """ - if issubclass(input_class_simple, OpenApiModel) and valid_classes == ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ): + if issubclass(input_class_simple, OpenApiModel) and \ + valid_classes == (bool, date, datetime, dict, float, int, list, str, none_type,): return True valid_type = input_class_simple in valid_classes if not valid_type and ( - issubclass(input_class_simple, OpenApiModel) or input_class_simple is none_type - ): + issubclass(input_class_simple, OpenApiModel) or + input_class_simple is none_type): for valid_class in valid_classes: if input_class_simple is none_type and is_type_nullable(valid_class): # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. @@ -1488,21 +1213,17 @@ def is_valid_type(input_class_simple, valid_classes): if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator): continue discr_propertyname_py = list(valid_class.discriminator.keys())[0] - discriminator_classes = valid_class.discriminator[discr_propertyname_py].values() + discriminator_classes = ( + valid_class.discriminator[discr_propertyname_py].values() + ) valid_type = is_valid_type(input_class_simple, discriminator_classes) if valid_type: return True return valid_type -def validate_and_convert_types( - input_value, - required_types_mixed, - path_to_item, - spec_property_naming, - _check_type, - configuration=None, -): +def validate_and_convert_types(input_value, required_types_mixed, path_to_item, + spec_property_naming, _check_type, configuration=None): """Raises a TypeError is there is a problem, otherwise returns value Args: @@ -1537,7 +1258,9 @@ def validate_and_convert_types( input_class_simple = get_simple_class(input_value) valid_type = is_valid_type(input_class_simple, valid_classes) if not valid_type: - if configuration or (input_class_simple == dict and dict not in valid_classes): + if (configuration + or (input_class_simple == dict + and dict not in valid_classes)): # if input_value is not valid_type try to convert it converted_instance = attempt_convert_item( input_value, @@ -1547,18 +1270,18 @@ def validate_and_convert_types( spec_property_naming, key_type=False, must_convert=True, - check_type=_check_type, + check_type=_check_type ) return converted_instance else: - raise get_type_error(input_value, path_to_item, valid_classes, key_type=False) + raise get_type_error(input_value, path_to_item, valid_classes, + key_type=False) # input_value's type is in valid_classes if len(valid_classes) > 1 and configuration: # there are valid classes which are not the current class valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, spec_property_naming, must_convert=False - ) + valid_classes, input_value, spec_property_naming, must_convert=False) if valid_classes_coercible: converted_instance = attempt_convert_item( input_value, @@ -1568,7 +1291,7 @@ def validate_and_convert_types( spec_property_naming, key_type=False, must_convert=False, - check_type=_check_type, + check_type=_check_type ) return converted_instance @@ -1576,7 +1299,9 @@ def validate_and_convert_types( # all types are of the required types and there are no more inner # variables left to look at return input_value - inner_required_types = child_req_types_by_current_type.get(type(input_value)) + inner_required_types = child_req_types_by_current_type.get( + type(input_value) + ) if inner_required_types is None: # for this type, there are not more inner variables left to look at return input_value @@ -1593,7 +1318,7 @@ def validate_and_convert_types( inner_path, spec_property_naming, _check_type, - configuration=configuration, + configuration=configuration ) elif isinstance(input_value, dict): if input_value == {}: @@ -1603,14 +1328,15 @@ def validate_and_convert_types( inner_path = list(path_to_item) inner_path.append(inner_key) if get_simple_class(inner_key) != str: - raise get_type_error(inner_key, inner_path, valid_classes, key_type=True) + raise get_type_error(inner_key, inner_path, valid_classes, + key_type=True) input_value[inner_key] = validate_and_convert_types( inner_val, inner_required_types, inner_path, spec_property_naming, _check_type, - configuration=configuration, + configuration=configuration ) return input_value @@ -1628,12 +1354,10 @@ def model_to_dict(model_instance, serialize=True): """ result = {} - def extract_item(item): - return ( - (item[0], model_to_dict(item[1], serialize=serialize)) - if hasattr(item[1], "_data_store") - else item - ) + def extract_item(item): return ( + item[0], model_to_dict( + item[1], serialize=serialize)) if hasattr( + item[1], '_data_store') else item model_instances = [model_instance] if model_instance._composed_schemas: @@ -1664,15 +1388,21 @@ def model_to_dict(model_instance, serialize=True): elif isinstance(v, ModelSimple): res.append(v.value) elif isinstance(v, dict): - res.append(dict(map(extract_item, v.items()))) + res.append(dict(map( + extract_item, + v.items() + ))) else: res.append(model_to_dict(v, serialize=serialize)) result[attr] = res elif isinstance(value, dict): - result[attr] = dict(map(extract_item, value.items())) + result[attr] = dict(map( + extract_item, + value.items() + )) elif isinstance(value, ModelSimple): result[attr] = value.value - elif hasattr(value, "_data_store"): + elif hasattr(value, '_data_store'): result[attr] = model_to_dict(value, serialize=serialize) else: result[attr] = value @@ -1690,7 +1420,8 @@ def model_to_dict(model_instance, serialize=True): return result -def type_error_message(var_value=None, var_name=None, valid_classes=None, key_type=None): +def type_error_message(var_value=None, var_name=None, valid_classes=None, + key_type=None): """ Keyword Args: var_value (any): the variable which has the type_error @@ -1701,9 +1432,9 @@ def type_error_message(var_value=None, var_name=None, valid_classes=None, key_ty True if it is a key in a dict False if our item is an item in a list """ - key_or_value = "value" + key_or_value = 'value' if key_type: - key_or_value = "key" + key_or_value = 'key' valid_classes_phrase = get_valid_classes_phrase(valid_classes) msg = ( "Invalid type for variable '{0}'. Required {1} type {2} and " @@ -1718,12 +1449,13 @@ def type_error_message(var_value=None, var_name=None, valid_classes=None, key_ty def get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed""" + """Returns a string phrase describing what types are allowed + """ all_classes = list(input_classes) all_classes = sorted(all_classes, key=lambda cls: cls.__name__) all_class_names = [cls.__name__ for cls in all_classes] if len(all_class_names) == 1: - return "is {0}".format(all_class_names[0]) + return 'is {0}'.format(all_class_names[0]) return "is one of [{0}]".format(", ".join(all_class_names)) @@ -1745,10 +1477,10 @@ def get_allof_instances(self, model_args, constant_args): composed_instances (list) """ composed_instances = [] - for allof_class in self._composed_schemas["allOf"]: + for allof_class in self._composed_schemas['allOf']: try: - if constant_args.get("_spec_property_naming"): + if constant_args.get('_spec_property_naming'): allof_instance = allof_class._from_openapi_data(**model_args, **constant_args) else: allof_instance = allof_class(**model_args, **constant_args) @@ -1757,8 +1489,12 @@ def get_allof_instances(self, model_args, constant_args): raise ApiValueError( "Invalid inputs given to generate an instance of '%s'. The " "input data was invalid for the allOf schema '%s' in the composed " - "schema '%s'. Error=%s" - % (allof_class.__name__, allof_class.__name__, self.__class__.__name__, str(ex)) + "schema '%s'. Error=%s" % ( + allof_class.__name__, + allof_class.__name__, + self.__class__.__name__, + str(ex) + ) ) from ex return composed_instances @@ -1791,13 +1527,13 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): Returns oneof_instance (instance) """ - if len(cls._composed_schemas["oneOf"]) == 0: + if len(cls._composed_schemas['oneOf']) == 0: return None oneof_instances = [] # Iterate over each oneOf schema and determine if the input data # matches the oneOf schemas. - for oneof_class in cls._composed_schemas["oneOf"]: + for oneof_class in cls._composed_schemas['oneOf']: # The composed oneOf schema allows the 'null' type and the input data # is the null value. This is a OAS >= 3.1 feature. if oneof_class is none_type: @@ -1809,28 +1545,26 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): try: if not single_value_input: - if constant_kwargs.get("_spec_property_naming"): + if constant_kwargs.get('_spec_property_naming'): oneof_instance = oneof_class._from_openapi_data( - **model_kwargs, **constant_kwargs - ) + **model_kwargs, **constant_kwargs) else: oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) else: if issubclass(oneof_class, ModelSimple): - if constant_kwargs.get("_spec_property_naming"): + if constant_kwargs.get('_spec_property_naming'): oneof_instance = oneof_class._from_openapi_data( - model_arg, **constant_kwargs - ) + model_arg, **constant_kwargs) else: oneof_instance = oneof_class(model_arg, **constant_kwargs) elif oneof_class in PRIMITIVE_TYPES: oneof_instance = validate_and_convert_types( model_arg, (oneof_class,), - constant_kwargs["_path_to_item"], - constant_kwargs["_spec_property_naming"], - constant_kwargs["_check_type"], - configuration=constant_kwargs["_configuration"], + constant_kwargs['_path_to_item'], + constant_kwargs['_spec_property_naming'], + constant_kwargs['_check_type'], + configuration=constant_kwargs['_configuration'] ) oneof_instances.append(oneof_instance) except Exception: @@ -1838,12 +1572,14 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): if len(oneof_instances) == 0: raise ApiValueError( "Invalid inputs given to generate an instance of %s. None " - "of the oneOf schemas matched the input data." % cls.__name__ + "of the oneOf schemas matched the input data." % + cls.__name__ ) elif len(oneof_instances) > 1: raise ApiValueError( "Invalid inputs given to generate an instance of %s. Multiple " - "oneOf schemas matched the inputs, but a max of one is allowed." % cls.__name__ + "oneOf schemas matched the inputs, but a max of one is allowed." % + cls.__name__ ) return oneof_instances[0] @@ -1863,10 +1599,10 @@ def get_anyof_instances(self, model_args, constant_args): anyof_instances (list) """ anyof_instances = [] - if len(self._composed_schemas["anyOf"]) == 0: + if len(self._composed_schemas['anyOf']) == 0: return anyof_instances - for anyof_class in self._composed_schemas["anyOf"]: + for anyof_class in self._composed_schemas['anyOf']: # The composed oneOf schema allows the 'null' type and the input data # is the null value. This is a OAS >= 3.1 feature. if anyof_class is none_type: @@ -1875,7 +1611,7 @@ def get_anyof_instances(self, model_args, constant_args): continue try: - if constant_args.get("_spec_property_naming"): + if constant_args.get('_spec_property_naming'): anyof_instance = anyof_class._from_openapi_data(**model_args, **constant_args) else: anyof_instance = anyof_class(**model_args, **constant_args) @@ -1885,7 +1621,8 @@ def get_anyof_instances(self, model_args, constant_args): if len(anyof_instances) == 0: raise ApiValueError( "Invalid inputs given to generate an instance of %s. None of the " - "anyOf schemas matched the inputs." % self.__class__.__name__ + "anyOf schemas matched the inputs." % + self.__class__.__name__ ) return anyof_instances @@ -1899,7 +1636,7 @@ def get_discarded_args(self, composed_instances, model_args): # arguments passed to self were already converted to python names # before __init__ was called for instance in composed_instances: - if instance.__class__ in self._composed_schemas["allOf"]: + if instance.__class__ in self._composed_schemas['allOf']: try: keys = instance.to_dict().keys() discarded_keys = model_args - keys @@ -1993,12 +1730,57 @@ def validate_get_composed_info(constant_args, model_args, self): for prop_name in model_args: if prop_name not in discarded_args: var_name_to_model_instances[prop_name] = [self] + list( - filter(lambda x: prop_name in x.openapi_types, composed_instances) - ) + filter( + lambda x: prop_name in x.openapi_types, composed_instances)) return [ composed_instances, var_name_to_model_instances, additional_properties_model_instances, - discarded_args, + discarded_args ] + +def to_json(obj, *, read_files: bool = True): + """ + Prepares data for transmission before it is sent with the rest client + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + If obj is io.IOBase, return the bytes + :param obj: The data to serialize. + :param read_files: Whether to read file data or leave files as is. + :return: The serialized form of data. + """ + if isinstance(obj, (ModelNormal, ModelComposed)): + return { + key: to_json(val, read_files=read_files) + for key, val in model_to_dict(obj, serialize=True).items() + } + elif isinstance(obj, io.IOBase): + if read_files: + return get_file_data_and_close_file(obj) + else: + return obj + elif isinstance(obj, (str, int, float, none_type, bool)): + return obj + elif isinstance(obj, (datetime, date)): + return obj.isoformat() + elif isinstance(obj, ModelSimple): + return to_json(obj.value, read_files=read_files) + elif isinstance(obj, (list, tuple)): + return [to_json(item, read_files=read_files) for item in obj] + if isinstance(obj, dict): + return { + key: to_json(val, read_files=read_files) + for key, val in obj.items() + } + raise ApiValueError(f'Unable to prepare type {obj.__class__.__name__} for serialization') + +def get_file_data_and_close_file(file_instance: file_type) -> bytes: + file_data = file_instance.read() + file_instance.close() + return file_data diff --git a/cvat-sdk/gen/templates/openapi-generator/requirements.mustache b/cvat-sdk/gen/templates/openapi-generator/requirements.mustache deleted file mode 100644 index 3afb9a44..00000000 --- a/cvat-sdk/gen/templates/openapi-generator/requirements.mustache +++ /dev/null @@ -1,12 +0,0 @@ -urllib3 >= 1.25.3 -python-dateutil -{{#asyncio}} -aiohttp >= 3.0.0 -{{/asyncio}} -{{#tornado}} -tornado >= 4.2,<5 -{{/tornado}} -{{#hasHttpSignatureMethods}} -pem >= 19.3.0 -pycryptodome >= 3.9.0 -{{/hasHttpSignatureMethods}} \ No newline at end of file diff --git a/cvat-sdk/gen/templates/openapi-generator/rest.mustache b/cvat-sdk/gen/templates/openapi-generator/rest.mustache index 674668cd..b293e371 100644 --- a/cvat-sdk/gen/templates/openapi-generator/rest.mustache +++ b/cvat-sdk/gen/templates/openapi-generator/rest.mustache @@ -72,7 +72,7 @@ class RESTClientObject(object): **addition_pool_args ) - def request(self, method, url, query_params=None, headers=None, files=None, + def request(self, method, url, query_params=None, headers=None, body=None, post_params=None, *, _parse_response=True, _request_timeout=None, _check_status=True) -> urllib3.HTTPResponse: """Perform requests. @@ -86,7 +86,6 @@ class RESTClientObject(object): when 'Content-Type' is `application/x-www-form-urlencoded` and `multipart/form-data` - :param files: file parameters for POST/PUT/PATCH requests :param _parse_response: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -129,6 +128,8 @@ class RESTClientObject(object): request_body = None if body is not None: request_body = json.dumps(body) + elif post_params and method == "POST": + request_body = json.dumps(post_params) r = self.pool_manager.request( method, url, body=request_body, @@ -136,11 +137,6 @@ class RESTClientObject(object): timeout=timeout, headers=headers) elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - if files: - raise ApiException( - "Files cannot be used when Content-Type " - "is 'application/x-www-form-urlencoded'" - ) r = self.pool_manager.request( method, url, fields=post_params, @@ -163,7 +159,7 @@ class RESTClientObject(object): # 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) or files: + elif isinstance(body, str) or isinstance(body, bytes): request_body = body r = self.pool_manager.request( method, url, diff --git a/cvat-sdk/gen/templates/openapi-generator/setup.mustache b/cvat-sdk/gen/templates/openapi-generator/setup.mustache index 7d3392bb..40cd4ac4 100644 --- a/cvat-sdk/gen/templates/openapi-generator/setup.mustache +++ b/cvat-sdk/gen/templates/openapi-generator/setup.mustache @@ -40,7 +40,18 @@ BASE_REQUIREMENTS_FILE = "requirements/base.txt" def parse_requirements(filename=BASE_REQUIREMENTS_FILE): with open(filename) as fh: - return fh.readlines() + reqs = [line.strip() for line in fh.readlines()] + + for req in reqs[:]: + if req.startswith('-r '): + dep = req.split(maxsplit=2)[1] + reqs.extend(parse_requirements(osp.join(osp.dirname(filename), dep.lstrip('/\\')))) + + for req in reqs[:]: + if req.startswith('-r '): + reqs.remove(req) + + return reqs BASE_REQUIREMENTS = parse_requirements(BASE_REQUIREMENTS_FILE) diff --git a/cvat-sdk/gen/templates/requirements/base.txt b/cvat-sdk/gen/templates/requirements/base.txt index b21d4038..77c2adea 100644 --- a/cvat-sdk/gen/templates/requirements/base.txt +++ b/cvat-sdk/gen/templates/requirements/base.txt @@ -1,2 +1,5 @@ -python_dateutil >= 2.5.3 -urllib3 >= 1.25.3 +-r api_client.txt + +attrs >= 21.4.0 +tqdm >= 4.64.0 +tuspy == 0.2.5 # have it pinned, because SDK has lots of patched TUS code diff --git a/cvat-sdk/gen/templates/requirements/development.txt b/cvat-sdk/gen/templates/requirements/development.txt deleted file mode 100644 index 175df0d1..00000000 --- a/cvat-sdk/gen/templates/requirements/development.txt +++ /dev/null @@ -1,6 +0,0 @@ --r base.txt - -black>=22.1.0 -inflection >= 0.5.1 -isort>=5.10.1 -ruamel.yaml>=0.17.21 diff --git a/cvat-sdk/pyproject.toml b/cvat-sdk/pyproject.toml index 9927dd69..67280a49 100644 --- a/cvat-sdk/pyproject.toml +++ b/cvat-sdk/pyproject.toml @@ -6,7 +6,10 @@ build-backend = "setuptools.build_meta" profile = "black" forced_separate = ["tests"] line_length = 100 +skip_gitignore = true # align tool behavior with Black +# Can't just use a pyproject in the root dir, so duplicate +# https://github.com/psf/black/issues/2863 [tool.black] line-length = 100 target-version = ['py38'] diff --git a/cvat-sdk/requirements/base.txt b/cvat-sdk/requirements/base.txt deleted file mode 100644 index b21d4038..00000000 --- a/cvat-sdk/requirements/base.txt +++ /dev/null @@ -1,2 +0,0 @@ -python_dateutil >= 2.5.3 -urllib3 >= 1.25.3 diff --git a/cvat-sdk/requirements/development.txt b/cvat-sdk/requirements/development.txt deleted file mode 100644 index 175df0d1..00000000 --- a/cvat-sdk/requirements/development.txt +++ /dev/null @@ -1,6 +0,0 @@ --r base.txt - -black>=22.1.0 -inflection >= 0.5.1 -isort>=5.10.1 -ruamel.yaml>=0.17.21 diff --git a/cvat-sdk/setup.py b/cvat-sdk/setup.py deleted file mode 100644 index 0cf3db1c..00000000 --- a/cvat-sdk/setup.py +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - -# CVAT REST API -# -# REST API for Computer Vision Annotation Tool (CVAT) # noqa: E501 -# -# The version of the OpenAPI document: alpha (2.0) -# Contact: support@cvat.ai -# Generated by: https://openapi-generator.tech - - -import os.path as osp -import re -from setuptools import find_packages, setup - -# To install the library, run the following -# -# python -m pip install . -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -def find_version(project_dir=None): - if not project_dir: - project_dir = osp.dirname(osp.abspath(__file__)) - - file_path = osp.join(project_dir, "version.py") - - with open(file_path, "r") as version_file: - version_text = version_file.read() - - # PEP440: - # https://www.python.org/dev/peps/pep-0440/#appendix-b-parsing-version-strings-with-regular-expressions - pep_regex = r"([1-9]\d*!)?(0|[1-9]\d*)(\.(0|[1-9]\d*))*((a|b|rc)(0|[1-9]\d*))?(\.post(0|[1-9]\d*))?(\.dev(0|[1-9]\d*))?" - version_regex = r"VERSION\s*=\s*.(" + pep_regex + ")." - match = re.match(version_regex, version_text) - if not match: - raise RuntimeError("Failed to find version string in '%s'" % file_path) - - version = version_text[match.start(1) : match.end(1)] - return version - - -BASE_REQUIREMENTS_FILE = "requirements/base.txt" - - -def parse_requirements(filename=BASE_REQUIREMENTS_FILE): - with open(filename) as fh: - return fh.readlines() - - -BASE_REQUIREMENTS = parse_requirements(BASE_REQUIREMENTS_FILE) - -with open("README.md", "r") as fh: - long_description = fh.read() - -setup( - name="cvat-sdk", - version=find_version(project_dir="cvat_sdk"), - description="CVAT REST API", - long_description=long_description, - long_description_content_type="text/markdown", - author="CVAT.ai team", - author_email="support@cvat.ai", - url="https://github.com/cvat-ai/cvat", - keywords=["OpenAPI", "OpenAPI-Generator", "CVAT REST API"], - classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - ], - python_requires=">=3.7", - install_requires=BASE_REQUIREMENTS, - package_dir={"": "."}, - packages=find_packages(include=["cvat_sdk*"]), - include_package_data=True, - license="MIT License", -) diff --git a/cvat/apps/dataset_manager/views.py b/cvat/apps/dataset_manager/views.py index 9d162c7e..8c3b1b2d 100644 --- a/cvat/apps/dataset_manager/views.py +++ b/cvat/apps/dataset_manager/views.py @@ -46,20 +46,20 @@ JOB_CACHE_TTL = DEFAULT_CACHE_TTL def export(dst_format, project_id=None, task_id=None, job_id=None, server_url=None, save_images=False): try: if task_id is not None: - db_instance = Task.objects.get(pk=task_id) logger = slogger.task[task_id] cache_ttl = TASK_CACHE_TTL export_fn = task.export_task + db_instance = Task.objects.get(pk=task_id) elif project_id is not None: - db_instance = Project.objects.get(pk=project_id) logger = slogger.project[project_id] cache_ttl = PROJECT_CACHE_TTL export_fn = project.export_project + db_instance = Project.objects.get(pk=project_id) else: - db_instance = Job.objects.get(pk=job_id) logger = slogger.job[job_id] cache_ttl = JOB_CACHE_TTL export_fn = task.export_job + db_instance = Job.objects.get(pk=job_id) cache_dir = get_export_cache_dir(db_instance) diff --git a/cvat/apps/engine/schema.py b/cvat/apps/engine/schema.py index 9737a65e..1480ca4e 100644 --- a/cvat/apps/engine/schema.py +++ b/cvat/apps/engine/schema.py @@ -5,6 +5,7 @@ from rest_framework import serializers from drf_spectacular.extensions import OpenApiSerializerExtension from drf_spectacular.plumbing import force_instance +from drf_spectacular.serializers import PolymorphicProxySerializerExtension class DataSerializerExtension(OpenApiSerializerExtension): @@ -48,5 +49,51 @@ class DataSerializerExtension(OpenApiSerializerExtension): return auto_schema._map_serializer(_Override(), direction, bypass_extensions=False) +class CustomProxySerializerExtension(PolymorphicProxySerializerExtension): + """ + Allows to patch PolymorphicProxySerializer-based schema. + + Override "target_component" in children classes. + """ + priority = 0 # restore normal priority + + target_component: str = '' + + @classmethod + def _matches(cls, target) -> bool: + if cls == __class__: + return False + + if not super()._matches(target): + return False + + return target.component_name == cls.target_component + +class AnyOfProxySerializerExtension(CustomProxySerializerExtension): + """ + Replaces oneOf with anyOf in the generated schema. Useful when + no disciminator field is available, and the options are + not mutually-exclusive. + """ + + def map_serializer(self, auto_schema, direction): + schema = super().map_serializer(auto_schema, direction) + schema['anyOf'] = schema.pop('oneOf') + return schema + +class MetaUserSerializerExtension(AnyOfProxySerializerExtension): + # Need to replace oneOf to anyOf for MetaUser variants + # Otherwise, clients cannot distinguish between classes + # using just input data. Also, we can't use discrimintator + # field here, because these serializers don't have such. + target_component = 'MetaUser' + +class PolymorphicProjectSerializerExtension(AnyOfProxySerializerExtension): + # Need to replace oneOf to anyOf for PolymorphicProject variants + # Otherwise, clients cannot distinguish between classes + # using just input data. Also, we can't use discrimintator + # field here, because these serializers don't have such. + target_component = 'PolymorphicProject' + __all__ = [] # No public symbols here diff --git a/cvat/apps/engine/serializers.py b/cvat/apps/engine/serializers.py index f95f435f..57560564 100644 --- a/cvat/apps/engine/serializers.py +++ b/cvat/apps/engine/serializers.py @@ -48,6 +48,9 @@ class UserSerializer(serializers.ModelSerializer): 'date_joined') read_only_fields = ('last_login', 'date_joined') write_only_fields = ('password', ) + extra_kwargs = { + 'last_login': { 'allow_null': True } + } class AttributeSerializer(serializers.ModelSerializer): values = serializers.ListField(allow_empty=True, @@ -439,7 +442,10 @@ class TaskReadSerializer(serializers.ModelSerializer): 'subset', 'organization', 'target_storage', 'source_storage', ) read_only_fields = fields - extra_kwargs = { 'organization': { 'allow_null': True } } + extra_kwargs = { + 'organization': { 'allow_null': True }, + 'overlap': { 'allow_null': True }, + } def to_representation(self, instance): response = super().to_representation(instance) diff --git a/cvat/apps/engine/views.py b/cvat/apps/engine/views.py index f516d862..58d724a7 100644 --- a/cvat/apps/engine/views.py +++ b/cvat/apps/engine/views.py @@ -233,7 +233,7 @@ class ServerViewSet(viewsets.ViewSet): '200': PolymorphicProxySerializer(component_name='PolymorphicProject', serializers=[ ProjectReadSerializer, ProjectSearchSerializer, - ], resource_type_field_name='name', many=True), + ], resource_type_field_name=None, many=True), }), create=extend_schema( summary='Method creates a new project', @@ -1728,7 +1728,7 @@ class CommentViewSet(viewsets.ModelViewSet): '200': PolymorphicProxySerializer(component_name='MetaUser', serializers=[ UserSerializer, BasicUserSerializer, - ], resource_type_field_name='username'), + ], resource_type_field_name=None), }), retrieve=extend_schema( summary='Method provides information of a specific user', @@ -1736,7 +1736,7 @@ class CommentViewSet(viewsets.ModelViewSet): '200': PolymorphicProxySerializer(component_name='MetaUser', serializers=[ UserSerializer, BasicUserSerializer, - ], resource_type_field_name='username'), + ], resource_type_field_name=None), }), partial_update=extend_schema( summary='Method updates chosen fields of a user', @@ -1744,7 +1744,7 @@ class CommentViewSet(viewsets.ModelViewSet): '200': PolymorphicProxySerializer(component_name='MetaUser', serializers=[ UserSerializer, BasicUserSerializer, - ], resource_type_field_name='username'), + ], resource_type_field_name=None), }), destroy=extend_schema( summary='Method deletes a specific user from the server', @@ -1792,7 +1792,7 @@ class UserViewSet(viewsets.GenericViewSet, mixins.ListModelMixin, '200': PolymorphicProxySerializer(component_name='MetaUser', serializers=[ UserSerializer, BasicUserSerializer, - ], resource_type_field_name='username'), + ], resource_type_field_name=None), }) @action(detail=False, methods=['GET']) def self(self, request): @@ -1803,7 +1803,7 @@ class UserViewSet(viewsets.GenericViewSet, mixins.ListModelMixin, serializer = serializer_class(request.user, context={ "request": request }) return Response(serializer.data) -@extend_schema(tags=['cloud storages']) +@extend_schema(tags=['cloudstorages']) @extend_schema_view( retrieve=extend_schema( summary='Method returns details of a specific cloud storage', diff --git a/cvat/requirements/development.txt b/cvat/requirements/development.txt index 1fd64777..d13dc840 100644 --- a/cvat/requirements/development.txt +++ b/cvat/requirements/development.txt @@ -1,7 +1,8 @@ -r base.txt -pylint==2.7.0 -pylint-django==2.3.0 -pylint-plugin-utils==0.6 + +pylint==2.14.5 +pylint-django==2.5.3 +pylint-plugin-utils==0.7 rope==0.17.0 django-extensions==3.0.8 Werkzeug==1.0.1 diff --git a/cvat/settings/base.py b/cvat/settings/base.py index 02d68b5f..668346b5 100644 --- a/cvat/settings/base.py +++ b/cvat/settings/base.py @@ -511,9 +511,9 @@ SPECTACULAR_SETTINGS = { # Set VERSION to None if only the request version should be rendered. 'VERSION': 'alpha (2.0)', 'CONTACT': { - 'name': 'Nikita Manovich', - 'url': 'https://github.com/nmanovic', - 'email': 'nikita.manovich@intel.com', + 'name': 'CVAT.ai team', + 'url': 'https://github.com/cvat-ai/cvat', + 'email': 'support@cvat.ai', }, 'LICENSE': { 'name': 'MIT License', diff --git a/site/content/en/docs/contributing/running-tests.md b/site/content/en/docs/contributing/running-tests.md index 1a0b95d9..65fda3ba 100644 --- a/site/content/en/docs/contributing/running-tests.md +++ b/site/content/en/docs/contributing/running-tests.md @@ -35,12 +35,12 @@ yarn run cypress:run:chrome yarn run cypress:run:chrome:canvas3d ``` -# REST API tests +# REST API, SDK and CLI tests **Initial steps** 1. Install all necessary requirements before running REST API tests: ``` - pip install -r ./tests/rest_api/requirements.txt + pip install -r ./tests/python/requirements.txt ``` **Running tests** @@ -48,7 +48,7 @@ yarn run cypress:run:chrome:canvas3d Run all REST API tests: ``` -pytest ./tests/rest_api +pytest ./tests/python ``` This command will automatically start all necessary docker containers. @@ -57,13 +57,13 @@ If you want to start/stop these containers without running tests use special options for it: ``` -pytest ./tests/rest_api --start-services -pytest ./tests/rest_api --stop-services +pytest ./tests/python --start-services +pytest ./tests/python --stop-services ``` If you need to rebuild your CVAT images add `--rebuild` option: ``` -pytest ./tests/rest_api --rebuild +pytest ./tests/python --rebuild ``` # Unit tests diff --git a/tests/rest_api/README.md b/tests/python/README.md similarity index 93% rename from tests/rest_api/README.md rename to tests/python/README.md index f8254cf5..a462357a 100644 --- a/tests/rest_api/README.md +++ b/tests/python/README.md @@ -24,9 +24,10 @@ the server calling REST API directly (as it done by users). the root directory of the cloned CVAT repository: ```console - pip install cvat-sdk/ - pip install -r tests/rest_api/requirements.txt - pytest tests/rest_api/ + pip install -e cvat-sdk/ + pip install -e cvat-cli/ + pip install -r tests/python/requirements.txt + pytest tests/python/ ``` See the [contributing guide](../../site/content/en/docs/contributing/running-tests.md) @@ -80,7 +81,7 @@ If you have updated the test database and want to update the assets/*.json files as well, run the appropriate script: ``` -python utils/dump_objects.py +python shared/utils/dump_objects.py ``` ## How to restore DB and data volume? @@ -88,8 +89,8 @@ python utils/dump_objects.py To restore DB and data volume, please use commands below. ```console -cat assets/cvat_db/data.json | docker exec -i test_cvat_1 python manage.py loaddata --format=json - -cat assets/cvat_db/cvat_data.tar.bz2 | docker exec -i test_cvat_1 tar --strip 3 -C /home/django/data/ -xj +cat shared/assets/cvat_db/data.json | docker exec -i test_cvat_1 python manage.py loaddata --format=json - +cat shared/assets/cvat_db/cvat_data.tar.bz2 | docker exec -i test_cvat_1 tar --strip 3 -C /home/django/data/ -xj ``` ## Assets directory structure @@ -151,7 +152,7 @@ Assets directory has two parts: ``` Rerun tests to see error messages: ``` - pytest ./tests/rest_api -s + pytest ./tests/python/rest_api -s ``` 1. If your tests was failed due to date field incompatibility and you have @@ -165,7 +166,7 @@ Assets directory has two parts: ``` Just dump JSON assets with: ``` - python3 tests/rest_api/utils/dump_objests.py + python3 tests/python/shared/utils/dump_objests.py ``` 1. If your test infrastructure has been corrupted and you have errors during db restoring. @@ -196,4 +197,3 @@ Assets directory has two parts: ``` docker exec test_cvat_db_1 psql -U root -d postgres -v from=cvat -v to=test_db -f restore.sql ``` - diff --git a/tests/python/cli/__init__.py b/tests/python/cli/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/python/cli/conftest.py b/tests/python/cli/conftest.py new file mode 100644 index 00000000..c36974b6 --- /dev/null +++ b/tests/python/cli/conftest.py @@ -0,0 +1,5 @@ +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +from sdk.fixtures import fxt_client # pylint: disable=unused-import diff --git a/tests/python/cli/test_cli.py b/tests/python/cli/test_cli.py new file mode 100644 index 00000000..29350772 --- /dev/null +++ b/tests/python/cli/test_cli.py @@ -0,0 +1,194 @@ +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +import io +import json +import os +from pathlib import Path + +import pytest +from cvat_sdk import exceptions, make_client +from cvat_sdk.core.tasks import TaskProxy +from cvat_sdk.core.types import ResourceType +from PIL import Image + +from sdk.util import generate_coco_json +from shared.utils.config import BASE_URL, USER_PASS +from shared.utils.helpers import generate_image_file + +from .util import generate_images, run_cli + + +class TestCLI: + @pytest.fixture(autouse=True) + def setup( + self, + changedb, # force fixture call order to allow DB setup + fxt_stdout: io.StringIO, + tmp_path: Path, + admin_user: str, + ): + self.tmp_path = tmp_path + self.stdout = fxt_stdout + self.host, self.port = BASE_URL.rsplit(":", maxsplit=1) + self.user = admin_user + self.password = USER_PASS + self.client = make_client( + host=self.host, port=self.port, credentials=(self.user, self.password) + ) + self.client.config.status_check_period = 0.01 + + yield + + self.tmp_path = None + + @pytest.fixture + def fxt_image_file(self): + img_path = self.tmp_path / "img_0.png" + with img_path.open("wb") as f: + f.write(generate_image_file(filename=str(img_path)).getvalue()) + + return img_path + + @pytest.fixture + def fxt_coco_file(self, fxt_image_file: Path): + img_filename = fxt_image_file + img_size = Image.open(img_filename).size + ann_filename = self.tmp_path / "coco.json" + generate_coco_json(ann_filename, img_info=(img_filename, *img_size)) + + yield ann_filename + + @pytest.fixture + def fxt_backup_file(self, fxt_new_task: TaskProxy, fxt_coco_file: str): + backup_path = self.tmp_path / "backup.zip" + + fxt_new_task.import_annotations("COCO 1.0", filename=fxt_coco_file) + fxt_new_task.download_backup(str(backup_path)) + + yield backup_path + + @pytest.fixture + def fxt_new_task(self): + files = generate_images(str(self.tmp_path), 5) + + task = self.client.create_task( + spec={ + "name": "test_task", + "labels": [{"name": "car"}, {"name": "person"}], + }, + resource_type=ResourceType.LOCAL, + resources=files, + ) + + return task + + def run_cli(self, cmd: str, *args: str, expected_code: int = 0) -> str: + run_cli( + self, + "--auth", + f"{self.user}:{self.password}", + "--server-host", + self.host, + "--server-port", + self.port, + cmd, + *args, + expected_code=expected_code, + ) + return self.stdout.getvalue() + + def test_can_create_task_from_local_images(self): + files = generate_images(str(self.tmp_path), 5) + + stdout = self.run_cli( + "create", + "test_task", + ResourceType.LOCAL.name, + *files, + "--labels", + json.dumps([{"name": "car"}, {"name": "person"}]), + "--completion_verification_period", + "0.01", + ) + + task_id = int(stdout.split()[-1]) + assert self.client.retrieve_task(task_id).size == 5 + + def test_can_list_tasks_in_simple_format(self, fxt_new_task: TaskProxy): + output = self.run_cli("ls") + + results = output.split("\n") + assert any(str(fxt_new_task.id) in r for r in results) + + def test_can_list_tasks_in_json_format(self, fxt_new_task: TaskProxy): + output = self.run_cli("ls", "--json") + + results = json.loads(output) + assert any(r["id"] == fxt_new_task.id for r in results) + + def test_can_delete_task(self, fxt_new_task: TaskProxy): + self.run_cli("delete", str(fxt_new_task.id)) + + with pytest.raises(exceptions.ApiException) as capture: + fxt_new_task.fetch() + + assert capture.value.status == 404 + + def test_can_download_task_annotations(self, fxt_new_task: TaskProxy): + filename: Path = self.tmp_path / "task_{fxt_new_task.id}-cvat.zip" + self.run_cli( + "dump", + str(fxt_new_task.id), + str(filename), + "--format", + "CVAT for images 1.1", + "--with-images", + "no", + "--completion_verification_period", + "0.01", + ) + + assert 0 < filename.stat().st_size + + def test_can_download_task_backup(self, fxt_new_task: TaskProxy): + filename: Path = self.tmp_path / "task_{fxt_new_task.id}-cvat.zip" + self.run_cli( + "export", + str(fxt_new_task.id), + str(filename), + "--completion_verification_period", + "0.01", + ) + + assert 0 < filename.stat().st_size + + @pytest.mark.parametrize("quality", ("compressed", "original")) + def test_can_download_task_frames(self, fxt_new_task: TaskProxy, quality: str): + out_dir = str(self.tmp_path / "downloads") + self.run_cli( + "frames", + str(fxt_new_task.id), + "0", + "1", + "--outdir", + out_dir, + "--quality", + quality, + ) + + assert set(os.listdir(out_dir)) == { + "task_{}_frame_{:06d}.jpg".format(fxt_new_task.id, i) for i in range(2) + } + + def test_can_upload_annotations(self, fxt_new_task: TaskProxy, fxt_coco_file: Path): + self.run_cli("upload", str(fxt_new_task.id), str(fxt_coco_file), "--format", "COCO 1.0") + + def test_can_create_from_backup(self, fxt_new_task: TaskProxy, fxt_backup_file: Path): + stdout = self.run_cli("import", str(fxt_backup_file)) + + task_id = int(stdout.split()[-1]) + assert task_id + assert task_id != fxt_new_task.id + assert self.client.retrieve_task(task_id).size == fxt_new_task.size diff --git a/tests/python/cli/util.py b/tests/python/cli/util.py new file mode 100644 index 00000000..073f81c6 --- /dev/null +++ b/tests/python/cli/util.py @@ -0,0 +1,33 @@ +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + + +import os +import os.path as osp +import unittest +from typing import Any, Union + +from shared.utils.helpers import generate_image_file + + +def run_cli(test: Union[unittest.TestCase, Any], *args: str, expected_code: int = 0) -> None: + from cvat_cli.__main__ import main + + if isinstance(test, unittest.TestCase): + # Unittest + test.assertEqual(expected_code, main(args), str(args)) + else: + # Pytest case + assert expected_code == main(args) + + +def generate_images(dst_dir: str, count: int): + filenames = [] + os.makedirs(dst_dir, exist_ok=True) + for i in range(count): + filename = osp.join(dst_dir, f"img_{i}.jpg") + with open(filename, "wb") as f: + f.write(generate_image_file().getvalue()) + filenames.append(filename) + return filenames diff --git a/tests/python/conftest.py b/tests/python/conftest.py new file mode 100644 index 00000000..e2e806c6 --- /dev/null +++ b/tests/python/conftest.py @@ -0,0 +1,7 @@ +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +from shared.fixtures.data import * +from shared.fixtures.init import * +from shared.fixtures.util import * diff --git a/tests/python/pyproject.toml b/tests/python/pyproject.toml new file mode 100644 index 00000000..e91d405b --- /dev/null +++ b/tests/python/pyproject.toml @@ -0,0 +1,11 @@ +[tool.isort] +profile = "black" +forced_separate = ["tests"] +line_length = 100 +skip_gitignore = true # align tool behavior with Black + +# Can't just use a pyproject in the root dir, so duplicate +# https://github.com/psf/black/issues/2863 +[tool.black] +line-length = 100 +target-version = ['py38'] diff --git a/tests/python/pytest.ini b/tests/python/pytest.ini new file mode 100644 index 00000000..6e7b9d6e --- /dev/null +++ b/tests/python/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +addopts = --verbose --capture=tee-sys diff --git a/tests/rest_api/requirements.txt b/tests/python/requirements.txt similarity index 84% rename from tests/rest_api/requirements.txt rename to tests/python/requirements.txt index 3356660b..e949f2f5 100644 --- a/tests/rest_api/requirements.txt +++ b/tests/python/requirements.txt @@ -1,4 +1,4 @@ -cvat-sdk +cvat-sdk==2.0 pytest==6.2.5 requests==2.26.0 deepdiff==5.6.0 diff --git a/tests/python/rest_api/__init__.py b/tests/python/rest_api/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/rest_api/test_analytics.py b/tests/python/rest_api/test_analytics.py similarity index 91% rename from tests/rest_api/test_analytics.py rename to tests/python/rest_api/test_analytics.py index 60685fe7..98f4304b 100644 --- a/tests/rest_api/test_analytics.py +++ b/tests/python/rest_api/test_analytics.py @@ -1,10 +1,11 @@ # Copyright (C) 2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation # # SPDX-License-Identifier: MIT import pytest from http import HTTPStatus -from rest_api.utils.config import server_get +from shared.utils.config import server_get @pytest.mark.usefixtures('dontchangedb') class TestGetAnalytics: diff --git a/tests/rest_api/test_cache_policy.py b/tests/python/rest_api/test_cache_policy.py similarity index 94% rename from tests/rest_api/test_cache_policy.py rename to tests/python/rest_api/test_cache_policy.py index 238ce8f6..70591657 100644 --- a/tests/rest_api/test_cache_policy.py +++ b/tests/python/rest_api/test_cache_policy.py @@ -1,10 +1,11 @@ # Copyright (C) 2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation # # SPDX-License-Identifier: MIT from http import HTTPStatus import re -from rest_api.utils.config import server_get +from shared.utils.config import server_get class TestCachePolicy: diff --git a/tests/rest_api/test_check_objects_integrity.py b/tests/python/rest_api/test_check_objects_integrity.py similarity index 94% rename from tests/rest_api/test_check_objects_integrity.py rename to tests/python/rest_api/test_check_objects_integrity.py index 6737fd9e..129c14af 100644 --- a/tests/rest_api/test_check_objects_integrity.py +++ b/tests/python/rest_api/test_check_objects_integrity.py @@ -1,4 +1,5 @@ # Copyright (C) 2021-2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation # # SPDX-License-Identifier: MIT @@ -6,7 +7,7 @@ import os.path as osp import glob import json from deepdiff import DeepDiff -from rest_api.utils import config +from shared.utils import config import pytest @pytest.mark.usefixtures('dontchangedb') diff --git a/tests/rest_api/test_cloud_storages.py b/tests/python/rest_api/test_cloud_storages.py similarity index 98% rename from tests/rest_api/test_cloud_storages.py rename to tests/python/rest_api/test_cloud_storages.py index 2fb17553..70293568 100644 --- a/tests/rest_api/test_cloud_storages.py +++ b/tests/python/rest_api/test_cloud_storages.py @@ -1,4 +1,5 @@ # Copyright (C) 2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation # # SPDX-License-Identifier: MIT @@ -6,7 +7,7 @@ import pytest from http import HTTPStatus from deepdiff import DeepDiff -from rest_api.utils.config import get_method, patch_method, post_method +from shared.utils.config import get_method, patch_method, post_method @pytest.mark.usefixtures('dontchangedb') class TestGetCloudStorage: diff --git a/tests/rest_api/test_invitations.py b/tests/python/rest_api/test_invitations.py similarity index 97% rename from tests/rest_api/test_invitations.py rename to tests/python/rest_api/test_invitations.py index dbc76123..dcb25324 100644 --- a/tests/rest_api/test_invitations.py +++ b/tests/python/rest_api/test_invitations.py @@ -1,10 +1,11 @@ # Copyright (C) 2021-2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation # # SPDX-License-Identifier: MIT from http import HTTPStatus import pytest -from rest_api.utils.config import post_method +from shared.utils.config import post_method @pytest.mark.usefixtures('changedb') class TestCreateInvitations: diff --git a/tests/rest_api/test_issues.py b/tests/python/rest_api/test_issues.py similarity index 98% rename from tests/rest_api/test_issues.py rename to tests/python/rest_api/test_issues.py index f2b02fee..50488d70 100644 --- a/tests/rest_api/test_issues.py +++ b/tests/python/rest_api/test_issues.py @@ -1,4 +1,5 @@ # Copyright (C) 2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation # # SPDX-License-Identifier: MIT @@ -7,7 +8,7 @@ from http import HTTPStatus from deepdiff import DeepDiff from copy import deepcopy -from rest_api.utils.config import post_method, patch_method +from shared.utils.config import post_method, patch_method @pytest.mark.usefixtures('changedb') class TestPostIssues: @@ -136,5 +137,3 @@ class TestPatchIssues: data = request_data(issue_id) self._test_check_response(username, issue_id, data, is_allow, org_id=org) - - diff --git a/tests/rest_api/test_jobs.py b/tests/python/rest_api/test_jobs.py similarity index 99% rename from tests/rest_api/test_jobs.py rename to tests/python/rest_api/test_jobs.py index 4c5fb218..249a7737 100644 --- a/tests/rest_api/test_jobs.py +++ b/tests/python/rest_api/test_jobs.py @@ -1,4 +1,5 @@ # Copyright (C) 2021-2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation # # SPDX-License-Identifier: MIT @@ -6,7 +7,7 @@ from http import HTTPStatus from deepdiff import DeepDiff import pytest from copy import deepcopy -from rest_api.utils.config import get_method, patch_method +from shared.utils.config import get_method, patch_method def get_job_staff(job, tasks, projects): job_staff = [] diff --git a/tests/rest_api/test_memberships.py b/tests/python/rest_api/test_memberships.py similarity index 97% rename from tests/rest_api/test_memberships.py rename to tests/python/rest_api/test_memberships.py index 51f472f2..ae4bb009 100644 --- a/tests/rest_api/test_memberships.py +++ b/tests/python/rest_api/test_memberships.py @@ -1,4 +1,5 @@ # Copyright (C) 2021-2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation # # SPDX-License-Identifier: MIT @@ -6,7 +7,7 @@ import pytest from http import HTTPStatus from deepdiff import DeepDiff -from rest_api.utils.config import get_method, patch_method +from shared.utils.config import get_method, patch_method @pytest.mark.usefixtures('dontchangedb') class TestGetMemberships: diff --git a/tests/rest_api/test_organizations.py b/tests/python/rest_api/test_organizations.py similarity index 97% rename from tests/rest_api/test_organizations.py rename to tests/python/rest_api/test_organizations.py index 7aa83940..d26b8532 100644 --- a/tests/rest_api/test_organizations.py +++ b/tests/python/rest_api/test_organizations.py @@ -1,10 +1,11 @@ # Copyright (C) 2021-2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation # # SPDX-License-Identifier: MIT from http import HTTPStatus import pytest -from rest_api.utils.config import get_method, options_method, patch_method, delete_method +from shared.utils.config import get_method, options_method, patch_method, delete_method from deepdiff import DeepDiff from copy import deepcopy diff --git a/tests/rest_api/test_projects.py b/tests/python/rest_api/test_projects.py similarity index 99% rename from tests/rest_api/test_projects.py rename to tests/python/rest_api/test_projects.py index 40226608..ef030210 100644 --- a/tests/rest_api/test_projects.py +++ b/tests/python/rest_api/test_projects.py @@ -15,7 +15,7 @@ from deepdiff import DeepDiff from cvat_sdk.models import DatasetFileRequest, ProjectWriteRequest -from .utils.config import get_method, patch_method, make_api_client +from shared.utils.config import get_method, patch_method, make_api_client @pytest.mark.usefixtures('dontchangedb') @@ -346,7 +346,7 @@ class TestImportExportDatasetProject: action='import_status') response.raise_for_status() if response.status_code == HTTPStatus.CREATED: - break + break def test_can_import_dataset_in_org(self): username = 'admin1' diff --git a/tests/rest_api/test_remote_url.py b/tests/python/rest_api/test_remote_url.py similarity index 95% rename from tests/rest_api/test_remote_url.py rename to tests/python/rest_api/test_remote_url.py index 5e795a2c..0ea28709 100644 --- a/tests/rest_api/test_remote_url.py +++ b/tests/python/rest_api/test_remote_url.py @@ -1,4 +1,5 @@ # Copyright (C) 2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation # # SPDX-License-Identifier: MIT @@ -7,7 +8,7 @@ from time import sleep import pytest -from rest_api.utils.config import get_method, post_method +from shared.utils.config import get_method, post_method def _post_task_remote_data(username, task_id, resources): diff --git a/tests/rest_api/test_resource_import_export.py b/tests/python/rest_api/test_resource_import_export.py similarity index 98% rename from tests/rest_api/test_resource_import_export.py rename to tests/python/rest_api/test_resource_import_export.py index d87cfc58..77ec8051 100644 --- a/tests/rest_api/test_resource_import_export.py +++ b/tests/python/rest_api/test_resource_import_export.py @@ -1,3 +1,8 @@ +# Copyright (C) 2021-2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + import pytest import boto3 import functools @@ -6,7 +11,7 @@ import json from botocore.exceptions import ClientError from http import HTTPStatus -from .utils.config import ( +from shared.utils.config import ( get_method, post_method, MINIO_KEY, MINIO_SECRET_KEY, MINIO_ENDPOINT_URL, ) diff --git a/tests/rest_api/test_tasks.py b/tests/python/rest_api/test_tasks.py similarity index 91% rename from tests/rest_api/test_tasks.py rename to tests/python/rest_api/test_tasks.py index c9ae5b15..7467509e 100644 --- a/tests/rest_api/test_tasks.py +++ b/tests/python/rest_api/test_tasks.py @@ -6,39 +6,20 @@ import json from copy import deepcopy from http import HTTPStatus -from io import BytesIO from time import sleep -from cvat_sdk.apis import TasksApi -from cvat_sdk.models import DataRequest, RqStatus, TaskWriteRequest, PatchedTaskWriteRequest +from cvat_sdk.api_client.apis import TasksApi +from cvat_sdk.api_client import models import pytest from deepdiff import DeepDiff -from PIL import Image -from .utils.config import make_api_client - - -def generate_image_file(filename, size=(50, 50)): - f = BytesIO() - image = Image.new('RGB', size=size) - image.save(f, 'jpeg') - f.name = filename - f.seek(0) - - return f - -def generate_image_files(count): - images = [] - for i in range(count): - image = generate_image_file(f'{i}.jpeg') - images.append(image) - - return images +from shared.utils.config import make_api_client +from shared.utils.helpers import generate_image_files def get_cloud_storage_content(username, cloud_storage_id, manifest): with make_api_client(username) as api_client: - (_, response) = api_client.cloud_storages_api.cloudstorages_retrieve_content(cloud_storage_id, manifest_path=manifest) - data = json.loads(response.data) + (data, _) = api_client.cloudstorages_api.retrieve_content(cloud_storage_id, + manifest_path=manifest) return data @@ -132,12 +113,12 @@ class TestGetTasks: class TestPostTasks: def _test_create_task_201(self, user, spec, **kwargs): with make_api_client(user) as api_client: - (_, response) = api_client.tasks_api.create(TaskWriteRequest(**spec), **kwargs) + (_, response) = api_client.tasks_api.create(models.TaskWriteRequest(**spec), **kwargs) assert response.status == HTTPStatus.CREATED def _test_create_task_403(self, user, spec, **kwargs): with make_api_client(user) as api_client: - (_, response) = api_client.tasks_api.create(TaskWriteRequest(**spec), **kwargs, + (_, response) = api_client.tasks_api.create(models.TaskWriteRequest(**spec), **kwargs, _parse_response=False, _check_status=False) assert response.status == HTTPStatus.FORBIDDEN @@ -229,7 +210,7 @@ class TestPatchTaskAnnotations: data = request_data(tid) with make_api_client(username) as api_client: - patched_data = PatchedTaskWriteRequest(**deepcopy(data)) + patched_data = models.PatchedTaskWriteRequest(**deepcopy(data)) (_, response) = api_client.tasks_api.partial_update_annotations( id=tid, action='update', org=org, patched_task_write_request=patched_data, @@ -252,7 +233,7 @@ class TestPatchTaskAnnotations: data = request_data(tid) with make_api_client(username) as api_client: - patched_data = PatchedTaskWriteRequest(**deepcopy(data)) + patched_data = models.PatchedTaskWriteRequest(**deepcopy(data)) (_, response) = api_client.tasks_api.partial_update_annotations( id=tid, org_id=org, action='update', patched_task_write_request=patched_data, @@ -283,7 +264,7 @@ class TestPostTaskData: _USERNAME = 'admin1' @staticmethod - def _wait_until_task_is_created(api: TasksApi, task_id: int) -> RqStatus: + def _wait_until_task_is_created(api: TasksApi, task_id: int) -> models.RqStatus: for _ in range(100): (status, _) = api.retrieve_status(task_id) if status.state.value in ['Finished', 'Failed']: @@ -293,10 +274,10 @@ class TestPostTaskData: def _test_create_task(self, username, spec, data, content_type, **kwargs): with make_api_client(username) as api_client: - (task, response) = api_client.tasks_api.create(TaskWriteRequest(**spec), **kwargs) + (task, response) = api_client.tasks_api.create(models.TaskWriteRequest(**spec), **kwargs) assert response.status == HTTPStatus.CREATED - task_data = DataRequest(**data) + task_data = models.DataRequest(**data) (_, response) = api_client.tasks_api.create_data(task.id, task_data, _content_type=content_type, **kwargs) assert response.status == HTTPStatus.ACCEPTED @@ -331,7 +312,8 @@ class TestPostTaskData: 'client_files': generate_image_files(7), } - task_id = self._test_create_task(self._USERNAME, task_spec, task_data, content_type="multipart/form-data") + task_id = self._test_create_task(self._USERNAME, task_spec, task_data, + content_type="multipart/form-data") # check task size with make_api_client(self._USERNAME) as api_client: @@ -361,4 +343,5 @@ class TestPostTaskData: 'server_files': cloud_storage_content, } - _ = self._test_create_task(self._USERNAME, task_spec, data_spec, content_type="application/json", org=org) + self._test_create_task(self._USERNAME, task_spec, data_spec, + content_type="application/json", org=org) diff --git a/tests/rest_api/test_users.py b/tests/python/rest_api/test_users.py similarity index 76% rename from tests/rest_api/test_users.py rename to tests/python/rest_api/test_users.py index 07b41458..9228bac2 100644 --- a/tests/rest_api/test_users.py +++ b/tests/python/rest_api/test_users.py @@ -6,11 +6,12 @@ from http import HTTPStatus import json import typing +from cvat_sdk.core.helpers import get_paginated_collection import pytest from deepdiff import DeepDiff -from rest_api.utils.config import make_api_client +from shared.utils.config import make_api_client @pytest.mark.usefixtures('dontchangedb') @@ -27,24 +28,8 @@ class TestGetUsers: assert response.status == HTTPStatus.OK response_data = json.loads(response.data) elif id_ is None: - fetch_all = kwargs.get('page_size') == 'all' - if fetch_all: - kwargs.pop('page_size') - - (_, response) = api_client.users_api.list(**kwargs, _parse_response=False) - assert response.status == HTTPStatus.OK - parsed_data = json.loads(response.data) - response_data = parsed_data.get('results', []) - - if fetch_all: - page_idx = 2 - while parsed_data.get('next'): - (_, response) = api_client.users_api.list(**kwargs, - _parse_response=False, page=page_idx) - assert response.status == HTTPStatus.OK - parsed_data = json.loads(response.data) - response_data += parsed_data.get('results', []) - page_idx += 1 + response_data = get_paginated_collection(api_client.users_api.list_endpoint, + return_json=True, **kwargs) else: (_, response) = api_client.users_api.retrieve(id_, **kwargs, _parse_response=False) @@ -71,8 +56,7 @@ class TestGetUsers: def test_admin_can_see_all_others(self, users): exclude_paths = [f"root[{i}]['last_login']" for i in range(len(users))] - self._test_can_see('admin2', users.raw, exclude_paths=exclude_paths, - page_size="all") + self._test_can_see('admin2', users.raw, exclude_paths=exclude_paths) def test_everybody_can_see_self(self, users_by_name): for user, data in users_by_name.items(): diff --git a/tests/python/sdk/__init__.py b/tests/python/sdk/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/python/sdk/conftest.py b/tests/python/sdk/conftest.py new file mode 100644 index 00000000..0ae4bef5 --- /dev/null +++ b/tests/python/sdk/conftest.py @@ -0,0 +1,5 @@ +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +from .fixtures import * diff --git a/tests/python/sdk/fixtures.py b/tests/python/sdk/fixtures.py new file mode 100644 index 00000000..9280f3d1 --- /dev/null +++ b/tests/python/sdk/fixtures.py @@ -0,0 +1,22 @@ +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +import pytest +from cvat_sdk import Client + +from shared.utils.config import BASE_URL + + +@pytest.fixture +def fxt_client(fxt_logger): + logger, _ = fxt_logger + + client = Client(BASE_URL, logger=logger) + api_client = client.api + for k in api_client.configuration.logger: + api_client.configuration.logger[k] = logger + client.config.status_check_period = 0.01 + + with client: + yield client diff --git a/tests/python/sdk/test_tasks.py b/tests/python/sdk/test_tasks.py new file mode 100644 index 00000000..7fbe84de --- /dev/null +++ b/tests/python/sdk/test_tasks.py @@ -0,0 +1,269 @@ +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +import io +import os.path as osp +from logging import Logger +from pathlib import Path +from typing import Tuple + +import pytest +from cvat_sdk import Client, exceptions +from cvat_sdk.core.tasks import TaskProxy +from cvat_sdk.core.types import ResourceType +from PIL import Image + +from shared.utils.config import USER_PASS +from shared.utils.helpers import generate_image_file, generate_image_files + +from .util import generate_coco_json, make_pbar + + +class TestTaskUsecases: + @pytest.fixture(autouse=True) + def setup( + self, + changedb, # force fixture call order to allow DB setup + tmp_path: Path, + fxt_logger: Tuple[Logger, io.StringIO], + fxt_client: Client, + fxt_stdout: io.StringIO, + admin_user: str, + ): + self.tmp_path = tmp_path + _, self.logger_stream = fxt_logger + self.client = fxt_client + self.stdout = fxt_stdout + self.user = admin_user + self.client.login((self.user, USER_PASS)) + + yield + + self.tmp_path = None + self.client = None + self.stdout = None + + @pytest.fixture + def fxt_image_file(self): + img_path = self.tmp_path / "img.png" + with img_path.open("wb") as f: + f.write(generate_image_file(filename=str(img_path)).getvalue()) + + return img_path + + @pytest.fixture + def fxt_coco_file(self, fxt_image_file): + img_filename = fxt_image_file + img_size = Image.open(img_filename).size + ann_filename = self.tmp_path / "coco.json" + generate_coco_json(ann_filename, img_info=(img_filename, *img_size)) + + yield ann_filename + + @pytest.fixture + def fxt_backup_file(self, fxt_new_task: TaskProxy, fxt_coco_file: str): + backup_path = self.tmp_path / "backup.zip" + + fxt_new_task.import_annotations("COCO 1.0", filename=fxt_coco_file) + fxt_new_task.download_backup(str(backup_path)) + + yield backup_path + + @pytest.fixture + def fxt_new_task(self, fxt_image_file): + task = self.client.create_task( + spec={ + "name": "test_task", + "labels": [{"name": "car"}, {"name": "person"}], + }, + resource_type=ResourceType.LOCAL, + resources=[fxt_image_file], + ) + + return task + + def test_can_create_task_with_local_data(self): + pbar_out = io.StringIO() + pbar = make_pbar(file=pbar_out) + + task_spec = { + "name": f"test {self.user} to create a task with local data", + "labels": [ + { + "name": "car", + "color": "#ff00ff", + "attributes": [ + { + "name": "a", + "mutable": True, + "input_type": "number", + "default_value": "5", + "values": ["4", "5", "6"], + } + ], + } + ], + } + + data_params = { + "image_quality": 75, + } + + task_files = generate_image_files(7) + for i, f in enumerate(task_files): + fname = self.tmp_path / osp.basename(f.name) + with fname.open("wb") as fd: + fd.write(f.getvalue()) + task_files[i] = str(fname) + + task = self.client.create_task( + spec=task_spec, + data_params=data_params, + resource_type=ResourceType.LOCAL, + resources=task_files, + pbar=pbar, + ) + + assert task.size == 7 + assert "100%" in pbar_out.getvalue().strip("\r").split("\r")[-1] + assert self.stdout.getvalue() == "" + + def test_cant_create_task_with_no_data(self): + pbar_out = io.StringIO() + pbar = make_pbar(file=pbar_out) + + task_spec = { + "name": f"test {self.user} to create a task with no data", + "labels": [ + { + "name": "car", + } + ], + } + + with pytest.raises(exceptions.ApiException) as capture: + self.client.create_task( + spec=task_spec, + resource_type=ResourceType.LOCAL, + resources=[], + pbar=pbar, + ) + + assert capture.match("No media data found") + assert self.stdout.getvalue() == "" + + def test_can_retrieve_task(self, fxt_new_task): + task_id = fxt_new_task.id + + task = self.client.retrieve_task(task_id) + + assert task.id == task_id + + def test_can_list_tasks(self, fxt_new_task): + task_id = fxt_new_task.id + + tasks = self.client.list_tasks() + + assert any(t.id == task_id for t in tasks) + assert self.stdout.getvalue() == "" + + def test_can_delete_tasks_by_ids(self, fxt_new_task): + task_id = fxt_new_task.id + old_tasks = self.client.list_tasks() + + self.client.delete_tasks([task_id]) + + new_tasks = self.client.list_tasks() + assert any(t.id == task_id for t in old_tasks) + assert all(t.id != task_id for t in new_tasks) + assert self.logger_stream.getvalue(), f".*Task ID {task_id} deleted.*" + assert self.stdout.getvalue() == "" + + def test_can_delete_task(self, fxt_new_task): + task_id = fxt_new_task.id + task = self.client.retrieve_task(task_id) + old_tasks = self.client.list_tasks() + + task.remove() + + new_tasks = self.client.list_tasks() + assert any(t.id == task_id for t in old_tasks) + assert all(t.id != task_id for t in new_tasks) + assert self.stdout.getvalue() == "" + + @pytest.mark.parametrize("include_images", (True, False)) + def test_can_download_dataset(self, fxt_new_task: TaskProxy, include_images: bool): + pbar_out = io.StringIO() + pbar = make_pbar(file=pbar_out) + + task_id = fxt_new_task.id + path = str(self.tmp_path / f"task_{task_id}-cvat.zip") + task = self.client.retrieve_task(task_id) + task.export_dataset( + format_name="CVAT for images 1.1", + filename=path, + pbar=pbar, + include_images=include_images, + ) + + assert "100%" in pbar_out.getvalue().strip("\r").split("\r")[-1] + assert osp.isfile(path) + assert self.stdout.getvalue() == "" + + def test_can_download_backup(self, fxt_new_task): + pbar_out = io.StringIO() + pbar = make_pbar(file=pbar_out) + + task_id = fxt_new_task.id + path = str(self.tmp_path / f"task_{task_id}-backup.zip") + task = self.client.retrieve_task(task_id) + task.download_backup(filename=path, pbar=pbar) + + assert "100%" in pbar_out.getvalue().strip("\r").split("\r")[-1] + assert osp.isfile(path) + assert self.stdout.getvalue() == "" + + @pytest.mark.parametrize("quality", ("compressed", "original")) + def test_can_download_frame(self, fxt_new_task: TaskProxy, quality: str): + frame_encoded = fxt_new_task.retrieve_frame(0, quality=quality) + + assert Image.open(frame_encoded).size != 0 + assert self.stdout.getvalue() == "" + + @pytest.mark.parametrize("quality", ("compressed", "original")) + def test_can_download_frames(self, fxt_new_task: TaskProxy, quality: str): + fxt_new_task.download_frames( + [0], + quality=quality, + outdir=str(self.tmp_path), + filename_pattern="frame-{frame_id}{frame_ext}", + ) + + assert osp.isfile(self.tmp_path / "frame-0.jpg") + assert self.stdout.getvalue() == "" + + def test_can_upload_annotations(self, fxt_new_task: TaskProxy, fxt_coco_file: Path): + pbar_out = io.StringIO() + pbar = make_pbar(file=pbar_out) + + fxt_new_task.import_annotations( + format_name="COCO 1.0", filename=str(fxt_coco_file), pbar=pbar + ) + + assert str(fxt_coco_file) in self.logger_stream.getvalue() + assert "100%" in pbar_out.getvalue().strip("\r").split("\r")[-1] + assert self.stdout.getvalue() == "" + + def test_can_create_from_backup(self, fxt_new_task: TaskProxy, fxt_backup_file: Path): + pbar_out = io.StringIO() + pbar = make_pbar(file=pbar_out) + + task = self.client.create_task_from_backup(str(fxt_backup_file), pbar=pbar) + + assert task.id + assert task.id != fxt_new_task.id + assert task.size == fxt_new_task.size + assert "exported sucessfully" in self.logger_stream.getvalue() + assert "100%" in pbar_out.getvalue().strip("\r").split("\r")[-1] + assert self.stdout.getvalue() == "" diff --git a/tests/python/sdk/util.py b/tests/python/sdk/util.py new file mode 100644 index 00000000..f554706c --- /dev/null +++ b/tests/python/sdk/util.py @@ -0,0 +1,84 @@ +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +import os.path as osp +import textwrap +from typing import Tuple + +from cvat_sdk.core.helpers import TqdmProgressReporter +from tqdm import tqdm + + +def make_pbar(file, **kwargs): + return TqdmProgressReporter(tqdm(file=file, mininterval=0, **kwargs)) + + +def generate_coco_json(filename: str, img_info: Tuple[str, int, int]): + image_filename, image_width, image_height = img_info + + content = generate_coco_anno( + osp.basename(image_filename), + image_width=image_width, + image_height=image_height, + ) + with open(filename, "w") as coco: + coco.write(content) + + +def generate_coco_anno(image_path: str, image_width: int, image_height: int) -> str: + return ( + textwrap.dedent( + """ + { + "categories": [ + { + "id": 1, + "name": "car", + "supercategory": "" + }, + { + "id": 2, + "name": "person", + "supercategory": "" + } + ], + "images": [ + { + "coco_url": "", + "date_captured": "", + "flickr_url": "", + "license": 0, + "id": 0, + "file_name": "%(image_path)s", + "height": %(image_height)d, + "width": %(image_width)d + } + ], + "annotations": [ + { + "category_id": 1, + "id": 1, + "image_id": 0, + "iscrowd": 0, + "segmentation": [ + [] + ], + "area": 17702.0, + "bbox": [ + 574.0, + 407.0, + 167.0, + 106.0 + ] + } + ] + } + """ + ) + % { + "image_path": image_path, + "image_height": image_height, + "image_width": image_width, + } + ) diff --git a/tests/rest_api/assets/annotations.json b/tests/python/shared/assets/annotations.json similarity index 100% rename from tests/rest_api/assets/annotations.json rename to tests/python/shared/assets/annotations.json diff --git a/tests/rest_api/assets/cloudstorages.json b/tests/python/shared/assets/cloudstorages.json similarity index 100% rename from tests/rest_api/assets/cloudstorages.json rename to tests/python/shared/assets/cloudstorages.json diff --git a/tests/rest_api/assets/cvat_db/cvat_data.tar.bz2 b/tests/python/shared/assets/cvat_db/cvat_data.tar.bz2 similarity index 100% rename from tests/rest_api/assets/cvat_db/cvat_data.tar.bz2 rename to tests/python/shared/assets/cvat_db/cvat_data.tar.bz2 diff --git a/tests/rest_api/assets/cvat_db/data.json b/tests/python/shared/assets/cvat_db/data.json similarity index 100% rename from tests/rest_api/assets/cvat_db/data.json rename to tests/python/shared/assets/cvat_db/data.json diff --git a/tests/rest_api/assets/cvat_db/restore.sql b/tests/python/shared/assets/cvat_db/restore.sql similarity index 100% rename from tests/rest_api/assets/cvat_db/restore.sql rename to tests/python/shared/assets/cvat_db/restore.sql diff --git a/tests/rest_api/assets/invitations.json b/tests/python/shared/assets/invitations.json similarity index 100% rename from tests/rest_api/assets/invitations.json rename to tests/python/shared/assets/invitations.json diff --git a/tests/rest_api/assets/issues.json b/tests/python/shared/assets/issues.json similarity index 100% rename from tests/rest_api/assets/issues.json rename to tests/python/shared/assets/issues.json diff --git a/tests/rest_api/assets/jobs.json b/tests/python/shared/assets/jobs.json similarity index 100% rename from tests/rest_api/assets/jobs.json rename to tests/python/shared/assets/jobs.json diff --git a/tests/rest_api/assets/memberships.json b/tests/python/shared/assets/memberships.json similarity index 100% rename from tests/rest_api/assets/memberships.json rename to tests/python/shared/assets/memberships.json diff --git a/tests/rest_api/assets/organizations.json b/tests/python/shared/assets/organizations.json similarity index 100% rename from tests/rest_api/assets/organizations.json rename to tests/python/shared/assets/organizations.json diff --git a/tests/rest_api/assets/projects.json b/tests/python/shared/assets/projects.json similarity index 100% rename from tests/rest_api/assets/projects.json rename to tests/python/shared/assets/projects.json diff --git a/tests/rest_api/assets/tasks.json b/tests/python/shared/assets/tasks.json similarity index 100% rename from tests/rest_api/assets/tasks.json rename to tests/python/shared/assets/tasks.json diff --git a/tests/rest_api/assets/users.json b/tests/python/shared/assets/users.json similarity index 100% rename from tests/rest_api/assets/users.json rename to tests/python/shared/assets/users.json diff --git a/tests/rest_api/docker-compose.minio.yml b/tests/python/shared/docker-compose.minio.yml similarity index 100% rename from tests/rest_api/docker-compose.minio.yml rename to tests/python/shared/docker-compose.minio.yml diff --git a/tests/python/shared/fixtures/__init__.py b/tests/python/shared/fixtures/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/rest_api/fixtures/data.py b/tests/python/shared/fixtures/data.py similarity index 96% rename from tests/rest_api/fixtures/data.py rename to tests/python/shared/fixtures/data.py index 5d9ea867..a4e819d7 100644 --- a/tests/rest_api/fixtures/data.py +++ b/tests/python/shared/fixtures/data.py @@ -1,11 +1,11 @@ -# Copyright (C) 2021-2022 Intel Corporation +# Copyright (C) 2022 CVAT.ai Corporation # # SPDX-License-Identifier: MIT import pytest import json import os.path as osp -from rest_api.utils.config import ASSETS_DIR +from shared.utils.config import ASSETS_DIR CVAT_DB_DIR = osp.join(ASSETS_DIR, 'cvat_db') @@ -282,3 +282,10 @@ def filter_tasks_with_shapes(annotations): @pytest.fixture(scope='session') def tasks_with_shapes(tasks, filter_tasks_with_shapes): return filter_tasks_with_shapes(tasks) + +@pytest.fixture(scope='session') +def admin_user(users): + for user in users: + if user["is_superuser"] and user["is_active"]: + return user["username"] + raise Exception("Can't find any admin user in the test DB") diff --git a/tests/rest_api/fixtures/init.py b/tests/python/shared/fixtures/init.py similarity index 92% rename from tests/rest_api/fixtures/init.py rename to tests/python/shared/fixtures/init.py index c153b0d1..8042db74 100644 --- a/tests/rest_api/fixtures/init.py +++ b/tests/python/shared/fixtures/init.py @@ -1,3 +1,7 @@ +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + import os.path as osp import re from http import HTTPStatus @@ -7,7 +11,7 @@ from time import sleep import pytest import os import requests -from rest_api.utils.config import ASSETS_DIR, get_api_url +from shared.utils.config import ASSETS_DIR, get_api_url CVAT_ROOT_DIR = __file__[: __file__.rfind(osp.join("tests", ""))] CVAT_DB_DIR = osp.join(ASSETS_DIR, "cvat_db") @@ -23,7 +27,7 @@ CONTAINER_NAME_FILES = [ DC_FILES = [ osp.join(CVAT_ROOT_DIR, dc_file) - for dc_file in ("docker-compose.dev.yml", "tests/rest_api/docker-compose.minio.yml") + for dc_file in ("docker-compose.dev.yml", "tests/python/shared/docker-compose.minio.yml") ] + CONTAINER_NAME_FILES @@ -222,6 +226,9 @@ def services(request): @pytest.fixture(scope="function") def changedb(): + # Note that autouse fixtures are executed first within their scope, so be aware of the order + # Pre-test DB setups (eg. with class-declared autouse setup() method) may be cleaned. + # https://docs.pytest.org/en/stable/reference/fixtures.html#autouse-fixtures-are-executed-first-within-their-scope restore_db() diff --git a/tests/python/shared/fixtures/util.py b/tests/python/shared/fixtures/util.py new file mode 100644 index 00000000..6d6c5aea --- /dev/null +++ b/tests/python/shared/fixtures/util.py @@ -0,0 +1,29 @@ +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +import io +import logging +import pytest + + +@pytest.fixture +def fxt_stdout(capsys): + class IoProxy(io.IOBase): + def __init__(self, capsys): + self.capsys = capsys + + def getvalue(self) -> str: + capture = self.capsys.readouterr() + return capture.out + + yield IoProxy(capsys) + + +@pytest.fixture +def fxt_logger(): + logger_stream = io.StringIO() + logger = logging.Logger("test", level=logging.INFO) + logger.propagate = False + logger.addHandler(logging.StreamHandler(logger_stream)) + yield logger, logger_stream diff --git a/tests/python/shared/utils/__init__.py b/tests/python/shared/utils/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/rest_api/utils/config.py b/tests/python/shared/utils/config.py similarity index 95% rename from tests/rest_api/utils/config.py rename to tests/python/shared/utils/config.py index 9d7f360e..377087a0 100644 --- a/tests/rest_api/utils/config.py +++ b/tests/python/shared/utils/config.py @@ -1,11 +1,10 @@ -# Copyright (C) 2021-2022 Intel Corporation # Copyright (C) 2022 CVAT.ai Corporation # # SPDX-License-Identifier: MIT import os.path as osp import requests -from cvat_sdk import ApiClient, Configuration +from cvat_sdk.api_client import ApiClient, Configuration ROOT_DIR = __file__[:__file__.rfind(osp.join("utils", ""))] ASSETS_DIR = osp.abspath(osp.join(ROOT_DIR, 'assets')) diff --git a/tests/python/shared/utils/dump_objects.py b/tests/python/shared/utils/dump_objects.py new file mode 100644 index 00000000..886f15b3 --- /dev/null +++ b/tests/python/shared/utils/dump_objects.py @@ -0,0 +1,25 @@ +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +import os.path as osp +from config import get_method, ASSETS_DIR +import json + +if __name__ == '__main__': + annotations = {} + for obj in ['user', 'project', 'task', 'job', 'organization', 'membership', + 'invitation', 'cloudstorage', 'issue']: + response = get_method('admin1', f'{obj}s', page_size='all') + with open(osp.join(ASSETS_DIR, f'{obj}s.json'), 'w') as f: + json.dump(response.json(), f, indent=2, sort_keys=True) + + if obj in ['job', 'task']: + annotations[obj] = {} + for _obj in response.json()['results']: + oid = _obj["id"] + response = get_method('admin1', f'{obj}s/{oid}/annotations') + annotations[obj][oid] = response.json() + + with open(osp.join(ASSETS_DIR, f'annotations.json'), 'w') as f: + json.dump(annotations, f, indent=2, sort_keys=True) diff --git a/tests/python/shared/utils/helpers.py b/tests/python/shared/utils/helpers.py new file mode 100644 index 00000000..3c93d4e2 --- /dev/null +++ b/tests/python/shared/utils/helpers.py @@ -0,0 +1,25 @@ +# Copyright (C) 2022 CVAT.ai Corporation +# +# SPDX-License-Identifier: MIT + +from typing import List +from PIL import Image +from io import BytesIO + + +def generate_image_file(filename='image.png', size=(50, 50)): + f = BytesIO() + image = Image.new('RGB', size=size) + image.save(f, 'jpeg') + f.name = filename + f.seek(0) + + return f + +def generate_image_files(count) -> List[BytesIO]: + images = [] + for i in range(count): + image = generate_image_file(f'{i}.jpeg') + images.append(image) + + return images diff --git a/tests/rest_api/__init__.py b/tests/rest_api/__init__.py deleted file mode 100644 index f7c3408e..00000000 --- a/tests/rest_api/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright (C) 2021-2022 Intel Corporation -# -# SPDX-License-Identifier: MIT diff --git a/tests/rest_api/conftest.py b/tests/rest_api/conftest.py deleted file mode 100644 index 02b0e448..00000000 --- a/tests/rest_api/conftest.py +++ /dev/null @@ -1,2 +0,0 @@ -from .fixtures.init import * -from .fixtures.data import * diff --git a/tests/rest_api/fixtures/__init__.py b/tests/rest_api/fixtures/__init__.py deleted file mode 100644 index f7c3408e..00000000 --- a/tests/rest_api/fixtures/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright (C) 2021-2022 Intel Corporation -# -# SPDX-License-Identifier: MIT diff --git a/tests/rest_api/pytest.ini b/tests/rest_api/pytest.ini deleted file mode 100644 index bc710381..00000000 --- a/tests/rest_api/pytest.ini +++ /dev/null @@ -1,2 +0,0 @@ -[pytest] -addopts = -s -v \ No newline at end of file diff --git a/tests/rest_api/utils/__init__.py b/tests/rest_api/utils/__init__.py deleted file mode 100644 index cec4f724..00000000 --- a/tests/rest_api/utils/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright (C) 2021-2022 Intel Corporation -# -# SPDX-License-Identifier: MIT \ No newline at end of file diff --git a/tests/rest_api/utils/dump_objects.py b/tests/rest_api/utils/dump_objects.py deleted file mode 100644 index 9ff0826c..00000000 --- a/tests/rest_api/utils/dump_objects.py +++ /dev/null @@ -1,20 +0,0 @@ -import os.path as osp -from config import get_method, ASSETS_DIR -import json - -annotations = {} -for obj in ['user', 'project', 'task', 'job', 'organization', 'membership', - 'invitation', 'cloudstorage', 'issue']: - response = get_method('admin1', f'{obj}s', page_size='all') - with open(osp.join(ASSETS_DIR, f'{obj}s.json'), 'w') as f: - json.dump(response.json(), f, indent=2, sort_keys=True) - - if obj in ['job', 'task']: - annotations[obj] = {} - for _obj in response.json()['results']: - oid = _obj["id"] - response = get_method('admin1', f'{obj}s/{oid}/annotations') - annotations[obj][oid] = response.json() - -with open(osp.join(ASSETS_DIR, f'annotations.json'), 'w') as f: - json.dump(annotations, f, indent=2, sort_keys=True)